Replies: 2 comments 1 reply
-
No help what so ever? Nobody knows when you get the "UNIX" version of the package? |
Beta Was this translation helpful? Give feedback.
1 reply
-
The symbolic link is
|
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I have been building an ubuntu image installing PowerShell on it. In different ways. First I had this
![image](https://private-user-images.githubusercontent.com/1316595/263213211-1936e670-ffed-48e8-8762-b11ca40170f5.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjI2NzUwMDksIm5iZiI6MTcyMjY3NDcwOSwicGF0aCI6Ii8xMzE2NTk1LzI2MzIxMzIxMS0xOTM2ZTY3MC1mZmVkLTQ4ZTgtODc2Mi1iMTFjYTQwMTcwZjUucG5nP1gtQW16LUFsZ29yaXRobT1BV1M0LUhNQUMtU0hBMjU2JlgtQW16LUNyZWRlbnRpYWw9QUtJQVZDT0RZTFNBNTNQUUs0WkElMkYyMDI0MDgwMyUyRnVzLWVhc3QtMSUyRnMzJTJGYXdzNF9yZXF1ZXN0JlgtQW16LURhdGU9MjAyNDA4MDNUMDg0NTA5WiZYLUFtei1FeHBpcmVzPTMwMCZYLUFtei1TaWduYXR1cmU9NWNjYzM0MDFiZTQ4N2M0YjI1NzY2ODhmM2Q5MjVlODU4MTMyZTI1MTM4MjRiN2QzYjVlYTdiZTc5MjViZDBiMyZYLUFtei1TaWduZWRIZWFkZXJzPWhvc3QmYWN0b3JfaWQ9MCZrZXlfaWQ9MCZyZXBvX2lkPTAifQ.Ww8elgdropPu9YyeLDAT1oUZtCyMYMl_XbRlaisqqcE)
But when we used this image to run a PowerShell command in our application, which is using PowerShellProcessInstance, we get an error that "-s" is an unknown cmdlet. "-s" we can see in the code is indeed automatically added. Is it because of the Powershell version we install?
I also noticed that in this case PowerShellProcessInstance.Process.StartInfo.FileName points to a "powershell.exe" not to "pwsh.exe". Setting it to "/usr/bin/pwsh" made it work (except for the -s" error).
I now created a different way of installing Powershell in our image. Using Powershell 7.4.0-preview.5.
![image](https://private-user-images.githubusercontent.com/1316595/263215497-88c3eda0-ef16-4e0d-85ea-46c2f0f096b9.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjI2NzUwMDksIm5iZiI6MTcyMjY3NDcwOSwicGF0aCI6Ii8xMzE2NTk1LzI2MzIxNTQ5Ny04OGMzZWRhMC1lZjE2LTRlMGQtODVlYS00NmMyZjBmMDk2YjkucG5nP1gtQW16LUFsZ29yaXRobT1BV1M0LUhNQUMtU0hBMjU2JlgtQW16LUNyZWRlbnRpYWw9QUtJQVZDT0RZTFNBNTNQUUs0WkElMkYyMDI0MDgwMyUyRnVzLWVhc3QtMSUyRnMzJTJGYXdzNF9yZXF1ZXN0JlgtQW16LURhdGU9MjAyNDA4MDNUMDg0NTA5WiZYLUFtei1FeHBpcmVzPTMwMCZYLUFtei1TaWduYXR1cmU9YmRhYWJmOTJkYjlhYmZjOTczNzgxNmY0MWRmNjRlYTViMzdlYmNiYTJmNmJkNWNhMDI2YTYzMmFkZmE5ZWRkYSZYLUFtei1TaWduZWRIZWFkZXJzPWhvc3QmYWN0b3JfaWQ9MCZrZXlfaWQ9MCZyZXBvX2lkPTAifQ.rkFjb77VW_c25lPdmMZbOfVM--p9MI7oILAU2lTLwrI)
Now the error is indeed gone. Is it because of the PowerShell version or because of the way I install it?
What I still noticed is that PowerShellProcessInstance.Process.StartInfo.FileName now points to a pwsh.exe that does not exist. I still need to set it to "/usr/bin/pwsh".
What I also noticed it that the PowerShellProcessInstance.cs files contains the compiler switch LINUX. So how does this work? When do I get the package where it was compiled with the switch defined? Is this when I actually build inside Linux and not on Windows?
Beta Was this translation helpful? Give feedback.
All reactions