I went to the Microsoft Script Archive
http://www.microsoft.com/technet/scr....mspx?mfr=true
and coppied the code for "List Physical Disk Properties" to DiskProp.ps1.
When I run it "./diskprop" I get the following error.
---------------
Unexpected token '_' in expression or statement.
At H:\PowerShell\DiskProp.ps1:2 char:44
+ Set objWMIService = GetObject("winmgmts:" _
---------------
First five lines of code are
strComputer = "."
Set objWMIService = GetObject("winmgmts:" _
& "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2")
Set colDiskDrives = objWMIService.ExecQuery _
("Select * from Win32_DiskDrive")
What's wrong?
Why can't I just copy the code and run it?
Thanks,
Ron.


