Can i have 2 version of PS installed on my machine

Hi All,
Can i install version 5.0 and 5.1 on the same machine?
Thanks

Version 5.1 would be an update of 5.0 - so “No”

But you could install Powershell 7 next to the existing Windows Powershell. :wink:

Why would you like to install these two versions next to each other? … just because I’m curious. :wink:

Thanks Olaf. Here is the story behind it. I have a PS Script on SERVER A which is a SQL Select statement that connects and loads the data into a flat file.
I had to implement the same process on SERVER B , it is the exact same process, but on SERVER B the data doesnt get loaded into the file, there is no error message either. SERVER A has PS 5.0 and SERVER B has 5.1, that is the reason .
Thanks

Hmmm … I think it’s pretty unlikely that the version of PowerShell is the reason for this. You may debug your script to find the root cause. I don’t know enough about SQL but I’m sure we have members here in the forum who do.
So you may share your script or at least the relevant part of it and they may be able to help.
Do you use any SQL specific modules you might need to install first on Server B for your script to work properly?

Thanks Olaf, the SQL Code is the exact same on both the servers and also there are other files getting loaded w/o issues. Just this one.

I’d still doubt that the version of PowerShell causes your issue. :wink:

1 Like

The latest Powershell should be installed on all devices as it’s just like anything else that is being patched for security and bugs. Concur with @Olaf that the least likely issue is the Powershell version. Depending on what the script is doing or the error you are receiving, we would be simply speculating, but it’s more likely there is another script dependency such as SQL Management Studio not being installed on the server that has the modules for Invoke-SqlCmd and other SQL tools installed. If you share the specific error, we would most likely be able to assist you.

1 Like

Thanks @rob-simmers there is no error message, the job runs fine and the file size is shown as 0KB.

Sharing your script (by replacing secrets with samples) here will help to understand the reason a lil bit I think.

1 Like