What exactly are you trying to achieve here?
A simple Get-WMIObject and a couple of Read-Hosts should do what you need it to:
$className = Read-Host "Enter Class Name"
$computerName = Read-Host "Enter Computer Name"
if ([string]::IsNullOrWhitespace($computerName)) {
$computerName = "."
}
Get-WmiObject -ComputerName $computerName -Class $className
Bolt in a bit of extra error checking so that you aren't trying to check an invalid class name etc and you should be good to go. Example below: 
You can also contatenate inside a command strings like so:
Get-WMIObject -Class ($string1 + "32" + "_" + $string2) -ComputerName "."
(in this case, $string1 contains "WIN" and $string2 contains "BIOS")
Things in brackets are processed before it's parent command. You can even go deeper and do brackets within brackets.. PowerShell will start at the deepest level and work it's way out until it hits the parent command and then execute the fully computed strings.
- - , .
برچسب:
نویسنده: استخدام کار