Ошибка - Get-WmiObject: The term 'Get-WmiObject' is not recognized as a name of a cmdlet

При попытке использовать скриптлет Get-WmiObject возникает ошибка:

Get-WmiObject: The term 'Get-WmiObject' is not recognized as a name of a cmdlet, function, script file, or executable program.
Check the spelling of the name, or if a path was included, verify that the path is correct and try again.

Смотрим версию PS:

$PSVersionTable

image

Начиная с 7 версии PS метод Get-WmiObject - упразднен и земенен методом - Get-CimInstance, пробуем:

Get-CimInstance -Class ‘Win32_OperatingSystem’ -ComputerName $hostName;

image

Done.

1 Like