Forum Discussion
Get-WindowsAutoPilotInfo - A quicker way...
SimonAllison this code didn't work for me on HP:
PowerShell -NoProfile -ExecutionPolicy Unrestricted -Command %~dp0Get-WindowsAutoPilotInfo.ps1 -ComputerName $env:computername -OutputFile %~dp0compHash.csv -append
so I just removed all the %~dp0 references, I also don't think either could define ComputerName $env:computername. I ran the below w/out any issues on both Dell and HP
PowerShell -NoProfile -ExecutionPolicy Unrestricted -Command Get-WindowsAutoPilotInfo.ps1 - -OutputFile compHash.csv -append
But for non-OOBE boxes, there's a new CIM error being thrown:
Get-CimInstance : A general error occurred that is not covered by a more specific error code.
At D:\Autopilot\Get-WindowsAutoPilotInfo.ps1:209 char:23
... evDetail = (Get-CimInstance -CimSession $session -Namespace root/cimv
the error is due to new KB5013942 or KB5011831
Once the KB(s) is uninstalled, the code runs. For me on W10 21H2 it was KB5013942. I have no idea if MS knows their update caused an issue or if there's a fix in the pipeline.