Windows Update Module Does Not Work with PowerShell 7 (P.3)
Steps to reproduce
- Install Windows Server 2019.
- Install Software Update Windows Feature (using Wincompat module to load server manager).
- Try to load the windows update module from PWSH7 - it does not load. This is sort of as expected since the module is not based on .NET Core (yet).
- Try to load the module via Windows Compatibility module - it works, but all returned objects have no methods because the remoting returns de-serialized objects (ie no methods)/
In WSUS, methods are used, not cmdlet. So for example, some common operations might be as follows:
# 1. Get WSUS Server object $WSUSServer = Get-WsusServer # 2. Get WSUS Server Configuration $WSUSServer.GetConfiguration() # fails # 3. Get WSUS Subscription(s) $WSUSSubscription = $WSUSServer.GetSubscription() # 4. Start-Synchronisation between this WSUS server and Windows Update $WSUSSubscription.StartSynchronization()
Expected behaviour:
I would have expected steps 2, 3, and 4 to have worked. Instead (when used via WInCompat module), the $WSUSServer object has been deserialised thus it looses all the methods needed in steps 2, 3, and 4.
Actual behaviour
No methods returned so can't for use the key methods.
The bottom line is that WSUS can not be managed using PowerShell 7 (today).
Environment data
> $PSVersionTable Name Value ---- ----- PSVersion 7.0.0-preview.3 PSEdition Core GitCommitId 7.0.0-preview.3 OS Microsoft Windows 10.0.17763 Platform Win32NT PSCompatibleVersions {1.0, 2.0, 3.0, 4.0, 5.0, 5.1.10032.0, 6.0.0, 6.1.0, 6.2.0, 7.0.0-preview.3} PSRemotingProtocolVersion 2.3 SerializationVersion 1.1.0.1 WSManStackVersion 3.0