Skip to content

Configuration, build and test Powershell scripts fail on older powershell with a confusing error #4810

@guhetier

Description

@guhetier

Describe the bug

The documentation indicates to run ./scripts/prepare-machine.ps1 to get dependencies and setup a device for building or testing.

This script doesn't work on PowerShell 5, it fails with:

The variable '$IsLinux' cannot be retrieved because it has not been set.
At line:1 char:1
+ scripts/prepare-machine.ps1
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : InvalidOperation: (IsLinux:String) [prepare-machine.ps1], RuntimeException
    + FullyQualifiedErrorId : VariableIsUndefined,prepare-machine.ps1

Affected OS

  • Windows
  • Linux
  • macOS
  • Other (specify below)

Additional OS information

No response

MsQuic version

main

Steps taken to reproduce bug

Run ./scripts/prepare-machine.ps1

Expected behavior

The script works

Actual outcome

The script fails with

The variable '$IsLinux' cannot be retrieved because it has not been set.
At line:1 char:1
+ scripts/prepare-machine.ps1
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : InvalidOperation: (IsLinux:String) [prepare-machine.ps1], RuntimeException
    + FullyQualifiedErrorId : VariableIsUndefined,prepare-machine.ps1

Additional details

No response

Metadata

Metadata

Assignees

Type

Projects

Status

Done

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions