Executing PowerShell script file from a batch file. The batch file creates 2 variables which are passed to the PowerShell script.
‘’’
Param(
[string]$FileIn,
[string]$FileOut
)
(Get-Content -Raw -Path $FileIn) -replace “(?<!r)
n”,“r
n” | Set-Content -Path $FileOut
‘’’
Complete error msg:
Processing -File ‘‘f:\scripts\unix2dos2.ps1’ -filein ‘f:\temp\SD_SACD_SDSUID.csv’ -fileout ‘f:\Oracle\oradata\SD_SACD_SDSUID.csv’’ failed: The given path’s format is not supported. Specify a valid path for the -File parameter.
Cmd to run PowerShell in batch is:
powershell.exe -file “‘f:\scripts\unix2dos2.ps1’ -filein ‘%fnfive%’ -fileout ‘%fnsix%’”
Any thoughts?
Thanks