Link to home
Start Free TrialLog in
Avatar of Ball_Group
Ball_Group

asked on

Powershell WMI and variables

Hi,

Im currently creating a PS scripts, which determines the model of the computer, and then do some stuff with it, depending on which model it is.
But just for testing purpose i've created a Write-Host to view the output.

Im having a few problems regarding WMI and variables/output.

Heres my code:
$computerModel = Get-WmiObject Win32_Computersystem | Select-Object Model
Write-Host $computerModel

For my point of view it looks okay, but the output does not in my eyes:
@{Model=Latitude E6420}

How am i able to just get "Latitude E6420" in my variable?
ASKER CERTIFIED SOLUTION
Avatar of Chris Dent
Chris Dent
Flag of United Kingdom of Great Britain and Northern Ireland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial