title: Passing path parameter into power shell script using batch file
body: <p>I would like to pass in a path variable --> param ([string]$w) into another parameter that store the path in power shell script. Then this power shell script is called using another batch file. I failed to pass in the $ which is the folder name that completes the full path . Please suggest me solution on this</p>
  
  <pre><code>$FilePath = "C:\Root\Main\Subfolder\param ([string]$w)\Table\" 
  $FileExists = Test-Path $FilePath 
  
    If ($FileExists -eq $True) 
       { Get-ChildItem -path C:\Root\Main\Subfolder\param ([string]$w)\Table\ -Recurse -Filter *.sql |
        ` Sort-Object -Property DirectoryName -Desc | `
        Foreach-Object -Process {$_.FullName } |ForEach-Object {sqlcmd -i $_}
       }
  
    Else {Write-Host "No file at this location"}
  </code></pre>
  
  <p>This is my batch file command line</p>
  
  <pre><code> PowerShell.Exe -File C:\Users\AZ\Desktop\PowerShell\untitled7.ps1 "Payment"
  </code></pre>