You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Jun 16, 2021. It is now read-only.
Repository navigation
This repository was archived by the owner on Jun 16, 2021. It is now read-only.
IISAdministration does not work on PowerShell 7. #84
IISAdministration does not work on PowerShell 7, even the latest release candidate.
I understand that the install does not install a required DLL.
There is also talk that some required 'bits' might not yet be ported to .Net Core.
the result is no known (decent) way to manage IIS services via PowerShell 7
WebAdministration is not being ported).
Get-ChildItem IIS: not functional (yet)
Steps to reproduce
install-Module -Name IISAdministration -allowclobber
import-module -name IISAdministration
Import-Module: Could not load file or assembly 'Microsoft.Web.Administration, Version=7.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35'. The system cannot find the file specified.
I believe these modules are managed by different teams and not the PowerShell team so any fixes to make it compatible needs to be done in the module itself, i.e.
DLL compiled to work with .NET core
Functions need to use functions/cmdlets that are supported in PowerShell 7
In the case that this isn't available you can use implicit remoting to import the module under PowerShell 5 but call them from PowerShell 7. This is done with the -UseWindowsPowerShell parameter.
PS C:\Windows\System32>Import-Module-Name IISAdministration -UseWindowsPowerShell
WARNING: Module IISAdministration is loaded in Windows PowerShell using WinPSCompatSession remoting session; please note that all input and output of commands from this module will be deserialized objects. If you want to load this module into PowerShell Core please use 'Import-Module -SkipEditionCheck' syntax.
There are some caveats with this, mainly that objects outputted by the module are a de serialized object so you cannot invoke methods on them. You can still access properties like normal though. If you need to get an object and invoke methods on them you can use Invoke-Command and run it in the context of PowerShell v5
$winPS=New-PSSession-UseWindowsPowerShell
Invoke-Command-Session $winPS-ScriptBlock {
Import-Module-Name IISAdministration
# Do work here
...
}
$winPS|Remove-PSSession
Is the information in this issue still up to date?
Please see my linked issue above.
I have found the IISAdministration module works fine in Powershell Core 7.0.3 however only on my local Windows 10 machine. The 1.1.0.0 version on the PSGallery does not appear to have been updated to work on Core and is missing the required Microsoft.Web.Administration DLL.
IISAdministration does not work on PowerShell 7, even the latest release candidate.
I understand that the install does not install a required DLL.
There is also talk that some required 'bits' might not yet be ported to .Net Core.
the result is no known (decent) way to manage IIS services via PowerShell 7
WebAdministration is not being ported).
Get-ChildItem IIS: not functional (yet)
Steps to reproduce
install-Module -Name IISAdministration -allowclobber
import-module -name IISAdministration
Import-Module: Could not load file or assembly 'Microsoft.Web.Administration, Version=7.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35'. The system cannot find the file specified.
Expected behavior
Works on Powershell 5