VMware Cloud Community
underlineX
Contributor
Contributor
Jump to solution

List out server hotfixes - date range

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

Reply
0 Kudos
1 Solution

Accepted Solutions
LucD
Leadership
Leadership
Jump to solution

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

View solution in original post

2 Replies
LucD
Leadership
Leadership
Jump to solution

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

underlineX
Contributor
Contributor
Jump to solution

@LucD Thank-You for your assistance, I will tailor any future questions to the appropriate sections, as I value the community and its support.  

Reply
0 Kudos