It works fine on v1 & v2
$strWMIClassName = "win32_process"
get-wmiobject -class $strWMIClassName
You didn't include the $strWMIClassName assignment in your post, check that
it's not $null
-----
Shay Levi
$cript Fanatic
http://scriptolog.blogspot.com
Hebrew weblog:
http://blogs.microsoft.co.il/blogs/scriptfanatic Quote:
> Hello I have the following problem while creating a script which
> contains the following line:
>
> Script line:
> get-wmiobject -class $strWMIClassName
> Error description:
> At xxx 1:74 char:15
> + get-wmiobject <<<< -class $strWMIClassName
> As you can see the var is not substituted. I have tried all the ways I
> do know from unix shells and so on how to substitute line $($var), `
> $var`, ${var}....
>
> Has anyone of you an idea how to solve this problem?
>
> Thanks
>
> Chris
>