Posted in
Windows Powershell |
No Comment | 2,806 views | 27/05/2015 18:00
As you know, LoadWithPartialName is now deprecated. So you need to change your codes.
You should use Add-Type instead of LoadWithPartialName. This is example alternative for that:
Add-Type -Path "C:\Windows\System32\inetsrv\Microsoft.Web.Administration.dll" |
Add-Type -Path "C:\Windows\System32\inetsrv\Microsoft.Web.Administration.dll"
That will load DLL into PowerShell session. So you have to specify full path now.
Then you can use it like:
New-Object Microsoft.Web.Administration.ServerManager |
New-Object Microsoft.Web.Administration.ServerManager
Now you can start exploring IIS using with Add-Type :)