dataplat / Invoke-SqlCmd2

PowerShell module containing Invoke-SqlCmd2
MIT License
68 stars 35 forks source link

Allow path with spaces #31

Closed franshaarman closed 2 years ago

franshaarman commented 2 years ago

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)

franshaarman commented 2 years ago

The actual issue I was trying to solve seems to be access things on the network, which this does not solve.

franshaarman commented 2 years ago

Looking at it again this might work:


$filePath = (Get-Item $InputFile).FullName

$Query =  [System.IO.File]::ReadAllText($filePath)