Skip to content

24.06.2 - 2_createParentDisks.ps1 fails in PowerShell 7 #602

Closed

Description

Don't see why

repro:
run Windows Server Insider b26296
install mslab 24.05.2
open Terminal > PowerShell 7.4.5
execute 1_Prereq
execute 2_CreateParentDisks

error:
PS H:\mslab_v24.06.2-2408-prod> .\2_CreateParentDisks.ps1

ParserError: H:\mslab_v24.06.2-2408-prod\2_CreateParentDisks.ps1:1056 Line | 1056 | … Import-DscResource -ModuleName PSDesiredStateConfiguratio … | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | Could not find the module 'PSDesiredStateConfiguration'.

Activity

  1. Karl-WE commented on Sep 29, 2024

    @Karl-WE
    ContributorAuthor

    doing the same Terminal > PS 5.1 works fine.

  2. Karl-WE commented on Sep 30, 2024

    @Karl-WE
    ContributorAuthor

    can confirm this in a different OS (W11).

  3. Karl-WE commented on Oct 3, 2024

    @Karl-WE
    ContributorAuthor

    Also confirm the same on WS 2022
    Seems like it's related to PS 7.4.5.
    Jaromir Kaspar (@jaromirk) can you repro this please
    1_prereq and Tests are ok
    2_createparentdisks fails

    Using Windows Terminal / PS 7.4.5 fails
    Using Windows Terminal / PS 5.1 works

    Tested OS
    WS Insider
    W11 24H2
    WS 2022

    If you see the same I believe it might be good opening an issue in PowerShell 7 repo. I would care about this.

  4. jaromirk commented on Oct 3, 2024

    @jaromirk
    Collaborator

    Yeah, it never worked with PS7

  5. Karl-WE commented on Oct 3, 2024

    @Karl-WE
    ContributorAuthor

    Sad to hear. 1 and deploy and other Script work well.
    OK I will open an issue in PowerShell github then.

  6. jaromirk commented on Oct 4, 2024

    @jaromirk
    Collaborator

    Does not make sense. It's incompatible with PowerShell DSC. It's a "feature"

  7. Karl-WE commented on Oct 4, 2024

    @Karl-WE
    ContributorAuthor

    OK. Thanks Jaromir. I have no insights so if you say they cannot fix this it's not worth trying.

    If I run createparentdisks from the subfolder there is no warning and termination

    Can I assume that only 2_createparentdisk is affected?

  8. michbern-ms commented on Oct 4, 2024

    @michbern-ms
    Collaborator

    Bug understood - this is a breaking change in PowerShell 7.2. I went ahead and coded up a fix, please try it out.

    #605

  9. jaromirk commented on Oct 5, 2024

    @jaromirk
    Collaborator

    Michael Bernstein (MSFT) (@michbern-ms) i added you as admin. Feel free to discuss internally with Vladimír (@machv) what's needed. Thank you for your contributions!

  10. michbern-ms commented on Oct 5, 2024

    @michbern-ms
    Collaborator

    Thanks, Jaromir - I'm honored. I think my fix should cover the PS7 issue. If there are other things we should look at together, please let me know.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions