Quantcast
Channel: The Official Scripting Guys Forum! forum
Viewing all articles
Browse latest Browse all 15028

Powershell and Hyphens

$
0
0

I am using powershell to list security events on remote servers.  I have come across a problem because some of our servers contain a hyphen in their name. 

get-eventlog -logname security -Computername Test-Server

I have tried to use Double Quotes and Single Quotes but I keep getting an invalid handle.  What is the correct way to pass a server name with a hyphen it its name to the command. 

Thanks

Duncan


Viewing all articles
Browse latest Browse all 15028

Trending Articles