I am new to PowerShell and I am getting powershell parsing error. My script is as:
$ServerName=".\SQL"
$ScriptLoc=$pwd
echo $pwd
$DrScript=$(scriptLoc)\main_file.sql
echo $DrScript
After executing the script I am getting:
Unexpected token '\main_file.sql' in expression or statement. At D:\Powershell-MyScripts\powerfile.ps1:8 char:45 + $DrScript=$(scriptLoc)\main_file.sql <<<< + CategoryInfo : ParserError: (\main_file.sql:String) [], ParseException + FullyQualifiedErrorId : UnexpectedToken
please help me to get over it.
PS: I am converting the batch script to Powershell script so I facing such error. Please advise if there is good tutorial which help me to get over this.