I have a win server 2016 1607 Build OS 14393.14 with IIS 10.0.14
I try to run some PowerShell scripts to configure websites.
Some of those code is as below
Start-Sleep -s 10
$site = Get-IISSite $siteName
While it executes, below error occurs
Get-IISSite : Could not load file or assembly 'Microsoft.Web.Administration, Version=22.214.171.124, Culture=neutral,
PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The system cannot find the file specified.
Start-IISCommitDelay : The type initializer for 'Microsoft.IIS.Powershell.Commands.MWAMgr' threw an exception.
At C:\Program Files (x86)\........MainScript.ps1:228 char:13
I have tried to copy Microsoft.Web.Management and Microsoft.Web.Administration dll file from some other (win 10 LTSC) to overwrite and test is it working. Failed to overwrite since access protected, though the use has admin privileges.
This same script works on win 10 and win 2019
Thank you for your consideration and help.