On Microsoft Windows, I have a customized PowerShell profile ("%USERPROFILE%\Documents\WindowsPowerShell\Microsoft.PowerShell_profile.ps1" and "%USERPROFILE%\Documents\PowerShell\Microsoft.PowerShell_profile.ps1"). I think that something in my PowerShell profile interfered with the batch file calls to PowerShell.exe.
I'm not sure exactly what in my profile interfered, but my profile includes starting some back jobs and additional output.
To resolve this in my case, I reviewed the batch file, and added the -NoProfile parameter to prevent my personal PowerShell profile from interfering. That is, I selectively replaced "powershell" with "powershell.exe -NoProfile".
On Microsoft Windows, I have a customized PowerShell profile ("%USERPROFILE%\Documents\WindowsPowerShell\Microsoft.PowerShell_profile.ps1" and "%USERPROFILE%\Documents\PowerShell\Microsoft.PowerShell_profile.ps1"). I think that something in my PowerShell profile interfered with the batch file calls to PowerShell.exe.
I'm not sure exactly what in my profile interfered, but my profile includes starting some back jobs and additional output.
To resolve this in my case, I reviewed the batch file, and added the -NoProfile parameter to prevent my personal PowerShell profile from interfering. That is, I selectively replaced "powershell" with "powershell.exe -NoProfile".