Skip to content
This repository was archived by the owner on Jun 12, 2023. It is now read-only.
This repository was archived by the owner on Jun 12, 2023. It is now read-only.

Windows Update Module Does Not Work with PowerShell 7 (P.3) #11

@doctordns

Description

@doctordns

Steps to reproduce

  1. Install Windows Server 2019.
  2. Install Software Update Windows Feature (using Wincompat module to load server manager).
  3. 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).
  4. 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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions