PoshWSUS icon indicating copy to clipboard operation
PoshWSUS copied to clipboard

Can't use Get-PSWSUSUpdate with -ExcludedInstallState

Open klmj opened this issue 9 years ago • 1 comments

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" ?

klmj avatar Jun 23 '16 08:06 klmj

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'.

garnul avatar May 30 '18 09:05 garnul