Welcome › Forums › General PowerShell Q&A › Hyphen (-) and PS
Hi, is there any restrictions on using the hyphen in PS?
I am importing records from windows firewall
import-csv -Path $FirewallLog -Delimiter " " -Header Date, Time, Action, Protocol, src-ip, dst-ip, srcport......
when I try to assign for example
$mySrc = $_.src-ip
I get a suiggly red line under src-ip. I tried the tick symbol to escape but it did not work
$mySrc = $_.src`-ip
Thanks for your help
$mySrc = $_.'src-ip'
$mySrc = $_."src-ip"
Lovely, it is working like a charm, thanks