Get-WmiObject error on asdk-prechecker

Robin Cai 21 Reputation points
2021-12-29T09:26:10.633+00:00

Hi there,

We've prepared a server to install and trial ASDK, when running asdk-prechecker.ps1 (https://github.com/Azure/AzureStack-Tools/tree/master/Deployment) on the server (with PowerShell 7.2.1) , it pops below error, it's appreciate if someone can share and advise the way to fix/upgrade the script, thanks.

'Get-WmiObject' is not recognized as a name of a cmdlet  

How to reproduce the issue: re-run the script

Potential root cause: Get-WmiObject deprecated in PowerShell core, need to use CIM cmdlets

Contact: robintptsai@Stuff .com

Azure Stack Hub
Azure Stack Hub
An extension of Azure for running apps in an on-premises environment and delivering Azure services in a datacenter.
189 questions
0 comments No comments
{count} votes

Accepted answer
  1. Prrudram-MSFT 24,916 Reputation points
    2022-01-07T07:03:42.87+00:00

    Hello @Robin Cai ,

    Yes, Get-WmiObject have been deprecated in PowerShell Core. If it's PowerShell 6+, WMI cmdlets don't work and the recommendation is to use the CIM cmdlets which can basically do the same thing. It will work with PS 5.1

    Let me know if your question is already answered or if you have any further queries?

    0 comments No comments

1 additional answer

Sort by: Most helpful
  1. Robin Cai 21 Reputation points
    2021-12-30T03:24:07.493+00:00

    Able the run asdk-prechecker.ps1 with Windows Power Shell 5.1 (Windows Server 2019 Standard)

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.