Example
if(Get-WmiObject -List | where { $_.Name -eq "Win32_PerfRawData_Counters_HyperVDynamicMemoryIntegrationService"})
{
write-output "class exist"
}
else
{
write-output "class do not exist"
}
I am checking the existence of wmi class "Win32_PerfRawData_Counters_HyperVDynamicMemoryIntegrationService".
On win2008 r2 / window7 and prev OS it does not exists therefore the code goes in else part.
On latest OS the if block get executed.
1 comment:
What tools are used to run the program? what is also used to store data?
Post a Comment