Can't use Get-PSWSUSUpdate with -ExcludedInstallState
Hi,
I'm trying to use Get-PSWSUSUpdate as :
Get-PSWSUSUpdate -ComputerTargetGroups 'Serveur' -ApprovedState Any -FromArrivalDate $($(get-date) - $(New-TimeSpan -Days 60)) -ExcludedInstallState NotApplicable,Installed
And got this error :
Get-PSWSUSUpdate : The property 'ExcludedInstallStates' cannot be found on this object. Verify that the property exists and can be set.
At line:1 char:1
+ Get-PSWSUSUpdate -ComputerTargetGroups 'Serveur' -ApprovedState Any -FromArrival ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidOperation: (:) [Get-PSWSUSUpdate], RuntimeException
+ FullyQualifiedErrorId : PropertyAssignmentException,Get-PSWSUSUpdate
I've tried with other paramters combination but none seems to work...
Could you explain how to use it please ?
Regards, klm
Edit: May be a spelling error in the script cause of the "S" on the parameter name in "The property 'ExcludedInstallStates' cannot be found on this object" ?
Hi All,
sorry to bother you once again regarding this issue, but after double-checking I got the latest version and even re-downloading the whole repo, I still get the same error.
Get-PSWSUSUpdate -ComputerTargetGroups "My fancy Target Group" -ExcludedInstallState NotApplicable,Installed
results in:
Get-PSWSUSUpdate : The property 'ExcludedInstallStates' cannot be found on this object. Verify that the property exists and can be set. At C:\Users\garnul\Desktop\PoshWSUS-master2\PoshWSUS-master\TestKitchen.ps1:35 char:1
- Get-PSWSUSUpdate -ComputerTargetGroups "My fancy Target Group" -ExcludedInsta ...
+ CategoryInfo : InvalidOperation: (:) [Get-PSWSUSUpdate], RuntimeException + FullyQualifiedErrorId : PropertyAssignmentException,Get-PSWSUSUpdate
Any suggestions what may go wrong here?
Thanks and best regards
//EDIT: I also tried to change the command to ExcludedInstallationState, this throws back
Get-PSWSUSUpdate : A parameter cannot be found that matches parameter name 'ExcludedInstallationState'.