I am working to list out all server hotfixes by date range. Running into a positional parameter cannot be found that accepts argument.
invoke-Command -ComputerName (Get-ADComputer -Filter *).Name {
Get-HotFix -ErrorAction SilentlyContinue |
where-Object { $_.InstalledOn -gt '01/1/2022' -AND $_.InstalledOn -lt '02/28/2022' }
} | Select-Object PSComputername, HotfixID, sort InstalledOn | Out-GridView
You are aware that this is a PowerCLI community and not a general PowerShell community?
In any case, like this, it works for me
Invoke-Command -ComputerName (Get-ADComputer -Filter 'Name -like "*"').Name -ErrorAction SilentlyContinue -ScriptBlock {
Get-HotFix -ErrorAction SilentlyContinue |
Where-Object { $_.InstalledOn -gt '01/1/2022' -AND $_.InstalledOn -lt '02/28/2022' }
} | Sort-Object -Property InstalledOn |
Select-Object PSComputername, HotfixID, InstalledOn |
Out-GridView
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
You are aware that this is a PowerCLI community and not a general PowerShell community?
In any case, like this, it works for me
Invoke-Command -ComputerName (Get-ADComputer -Filter 'Name -like "*"').Name -ErrorAction SilentlyContinue -ScriptBlock {
Get-HotFix -ErrorAction SilentlyContinue |
Where-Object { $_.InstalledOn -gt '01/1/2022' -AND $_.InstalledOn -lt '02/28/2022' }
} | Sort-Object -Property InstalledOn |
Select-Object PSComputername, HotfixID, InstalledOn |
Out-GridView
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
@LucD Thank-You for your assistance, I will tailor any future questions to the appropriate sections, as I value the community and its support.