Hi ,
I find Getting WMI Objects (Get-WmiObject) ,and try to use it.
But the powershell can not recognize it.
Get-WmiObject -List
__SecurityRelatedClass __NTLMUser9X
__PARAMETERS __SystemSecurity
__NotifyStatus __ExtendedStatus
Win32_PrivilegesStatus Win32_TSNetworkAdapterSettingError
Win32_TSRemoteControlSettingError Win32_TSEnvironmentSettingError
...
Get-WmiObject : The term 'Get-WmiObject' is not recognized as the name of a cmdlet, function, script file, or operable
program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again.
At line:1 char:1
+ Get-WmiObject -List
+ ~~~~~~~~~~~~~
+ CategoryInfo : ObjectNotFound: (Get-WmiObject:String) [], CommandNotFoundException
+ FullyQualifiedErrorId : CommandNotFoundException
> $PSVersionTable
Name Value
---- -----
PSVersion 6.0.0-beta
PSEdition Core
GitCommitId v6.0.0-beta.6
OS Microsoft Windows 10.0.10586
Platform Win32NT
PSCompatibleVersions {1.0, 2.0, 3.0, 4.0...}
PSRemotingProtocolVersion 2.3
SerializationVersion 1.1.0.1
WSManStackVersion 3.0
Btw, the command works in this version,which come with win10
PS C:\Users\clu> $PSVersionTable
Name Value
---- -----
PSVersion 5.0.10586.1045
PSCompatibleVersions {1.0, 2.0, 3.0, 4.0...}
BuildVersion 10.0.10586.1045
CLRVersion 4.0.30319.42000
WSManStackVersion 3.0
PSRemotingProtocolVersion 2.3
SerializationVersion 1.1.0.1
Get-WmiObject have been deprecated in PowerShell Core. Please use CIM cmdlets.
Docs Issue #1645
@iSazonov what did you mean by CIM?
It seems cim can not be recognized too.
PS C:\Program Files\PowerShell\6.0.0-beta.6> cim win32_service -Filter "name='LBS_MONITOR'"
cim : The term 'cim' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the s
pelling of the name, or if a path was included, verify that the path is correct and try again.
At line:1 char:1
+ cim win32_service -Filter "name='LBS_MONITOR'"
+ ~~~
+ CategoryInfo : ObjectNotFound: (cim:String) [], CommandNotFoundException
+ FullyQualifiedErrorId : CommandNotFoundException
@iSazonov thanks,I have google CIM, and find the docs
finally, I come with this command
Get-CimInstance -ClassName Win32_Service -Filter "name='LISA_43_Dev_Batch'" | select Name,DisplayName,StartMode,State,StartName,SystemName,Description |Format-Table -AutoSize
@chucklu - Are you asking a question about this command? Does it work as you expected? Can this issue be closed?
BTW, did you ever work at Novell?
@Liturgist no problem now, and this issue can be closed.
I am in China, have no idea about Novell.
Most helpful comment
finally, I come with this command