Closed franshaarman closed 2 years ago
The actual issue I was trying to solve seems to be access things on the network, which this does not solve.
Looking at it again this might work:
$filePath = (Get-Item $InputFile).FullName
$Query = [System.IO.File]::ReadAllText($filePath)
https://github.com/dataplat/Invoke-SqlCmd2/blob/c6f1051a8feef84a938615fad300fc4552de9e05/Invoke-SqlCmd2/Public/Invoke-SqlCmd2.ps1#L357
If you remove the double quotes it will allow $filepath to contain spaces.
$Query = [System.IO.File]::ReadAllText($filePath)