Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Compile.ps1 does not work on Windows (Powershell 5.1 Desktop) #286

Open
GamingMinds-UlfW opened this issue Aug 4, 2023 · 1 comment
Open

Comments

@GamingMinds-UlfW
Copy link

Compile.ps1 (and all other scripts which use Join-Path e.g. RunSharpmake.ps1) do not work on the Windows platform (for me Windows 10 x64 22H2) with the default Powershell (5.1 Desktop).

The error output is something like this (this is just a sample using no parameters, when using seemingly correct parameter values the output is the same):

--- Compile , debug| with
working folder : E:\Source\Sharpmake
working folder : E:\Source\Sharpmake
msbuild compile
E:\Source\Sharpmake\Compile.ps1 : System.Management.Automation.ParameterBindingException: Es wurde kein
Positionsparameter gefunden, der das Argument "windows" akzeptiert.
   bei System.Management.Automation.ExceptionHandlingOps.CheckActionPreference(FunctionContext funcContext, Exception
exception)
   bei System.Management.Automation.Interpreter.ActionCallInstruction`2.Run(InterpretedFrame frame)
   bei System.Management.Automation.Interpreter.EnterTryCatchFinallyInstruction.Run(InterpretedFrame frame)
   bei System.Management.Automation.Interpreter.EnterTryCatchFinallyInstruction.Run(InterpretedFrame frame)
In Zeile:1 Zeichen:1
+ .\Compile.ps1
+ ~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (:) [Write-Error], WriteErrorException
    + FullyQualifiedErrorId : Microsoft.PowerShell.Commands.WriteErrorException,Compile.ps1

The error occurs in line 202, due to Join-Path only accepting two arguments. Maybe I need to use a different powershell version, but I think the scripts should work with the default Powershell shipped with the OS.

@sylvainfortin
Copy link
Collaborator

Hi @GamingMinds-UlfW. Powershell scripts were added recently. Although it would be nice if it could work out of the box on Windows, we choose the latest version of Powershell (pwsh) because of its multi-platforms support. Keep in mind that Sharpmake can also be run on Linux and Mac environments.

That being said. If you think these scripts can be changed in a way that they could be used on both version of Powershell you can open a pull request.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants