*Start-PSBootstrap* should work on PowerShell 5.1
*Start-PSBootstrap* throws error on PowerShell 5.1
Import-Module .\build.psm1
Start-PSBootstrap
Installing PowerShell build dependencies
VERBOSE: Calling Find-Dotnet from Start-PSBootstrap
VERBOSE: In Find-DotNet
ForEach-Object : Unable to find type [System.Management.Automation.SemanticVersion].
At D:\DEVELOPMENT\PowerShellCore\build.psm1:2106 char:81
+ ... *\.\d*)?' | ForEach-Object { [System.Management.Automation.SemanticVe ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidOperation: (System.Manageme...SemanticVersion:TypeName) [ForEach-Object], RuntimeException
+ FullyQualifiedErrorId : TypeNotFound,Microsoft.PowerShell.Commands.ForEachObjectCommand
$error[0]|fl * -force
PSMessageDetails :
Exception : System.Management.Automation.RuntimeException: Unable to find type [System.Management.Automation.SemanticVersion].
at System.Management.Automation.ExceptionHandlingOps.CheckActionPreference(FunctionContext funcContext, Exception exception)
at System.Management.Automation.Interpreter.ActionCallInstruction`2.Run(InterpretedFrame frame)
at System.Management.Automation.Interpreter.EnterTryCatchFinallyInstruction.Run(InterpretedFrame frame)
at System.Management.Automation.Interpreter.EnterTryCatchFinallyInstruction.Run(InterpretedFrame frame)
at System.Management.Automation.Interpreter.Interpreter.Run(InterpretedFrame frame)
at System.Management.Automation.Interpreter.LightLambda.RunVoid1[T0](T0 arg0)
at System.Management.Automation.ScriptBlock.InvokeWithPipeImpl(ScriptBlockClauseToInvoke clauseToInvoke, Boolean createLocalScope, Dictionary`2 functionsToDefine, List`1
variablesToDefine, ErrorHandlingBehavior errorHandlingBehavior, Object dollarUnder, Object input, Object scriptThis, Pipe outputPipe, InvocationInfo invocationInfo, Object[] args)
at System.Management.Automation.ScriptBlock.<>c__DisplayClass57_0.<InvokeWithPipe>b__0()
at System.Management.Automation.Runspaces.RunspaceBase.RunActionIfNoRunningPipelinesWithThreadCheck(Action action)
at System.Management.Automation.ScriptBlock.InvokeWithPipe(Boolean useLocalScope, ErrorHandlingBehavior errorHandlingBehavior, Object dollarUnder, Object input, Object scriptThis,
Pipe outputPipe, InvocationInfo invocationInfo, Boolean propagateAllExceptionsToTop, List`1 variablesToDefine, Dictionary`2 functionsToDefine, Object[] args)
at System.Management.Automation.ScriptBlock.InvokeUsingCmdlet(Cmdlet contextCmdlet, Boolean useLocalScope, ErrorHandlingBehavior errorHandlingBehavior, Object dollarUnder, Object
input, Object scriptThis, Object[] args)
at Microsoft.PowerShell.Commands.ForEachObjectCommand.ProcessRecord()
at System.Management.Automation.CommandProcessor.ProcessRecord()
TargetObject : System.Management.Automation.SemanticVersion
CategoryInfo : InvalidOperation: (System.Manageme...SemanticVersion:TypeName) [], RuntimeException
FullyQualifiedErrorId : TypeNotFound
ErrorDetails :
InvocationInfo : System.Management.Automation.InvocationInfo
ScriptStackTrace : at <ScriptBlock>, D:\DEVELOPMENT\PowerShellCore\build.psm1: line 2106
at <ScriptBlock>, D:\DEVELOPMENT\PowerShellCore\build.psm1: line 2106
at script:Start-NativeExecution, D:\DEVELOPMENT\PowerShellCore\tools\buildCommon\startNativeExecution.ps1: line 22
at Get-LatestInstalledSDK, D:\DEVELOPMENT\PowerShellCore\build.psm1: line 2105
at Find-Dotnet, D:\DEVELOPMENT\PowerShellCore\build.psm1: line 2259
at Start-PSBootstrap, D:\DEVELOPMENT\PowerShellCore\build.psm1: line 2054
at <ScriptBlock>, <No file>: line 1
PipelineIterationInfo : {}
Prerequisites
Steps to reproduce
Start-PSBootstrap fails on PowerShell 5.1 due to use of unsupported type
[System.Management.Automation.SemanticVersion]in build.psm1 therefore it is not possible to build latest versions of PowerShell 7 on PowerShell 5.1 anymore.Expected behavior
*Start-PSBootstrap* should work on PowerShell 5.1Actual behavior
*Start-PSBootstrap* throws error on PowerShell 5.1Error details
Environment data
Visuals