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

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

Closed
Karl-WE opened this issue Sep 29, 2024 · 10 comments
Closed

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

Karl-WE opened this issue Sep 29, 2024 · 10 comments

Comments

@Karl-WE
Copy link
Contributor

Karl-WE commented Sep 29, 2024

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'.

@Karl-WE
Copy link
Contributor Author

Karl-WE commented Sep 29, 2024

doing the same Terminal > PS 5.1 works fine.

@Karl-WE
Copy link
Contributor Author

Karl-WE commented Sep 30, 2024

can confirm this in a different OS (W11).

@Karl-WE
Copy link
Contributor Author

Karl-WE commented Oct 3, 2024

Also confirm the same on WS 2022
Seems like it's related to PS 7.4.5.
@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.

@jaromirk
Copy link
Collaborator

jaromirk commented Oct 3, 2024

Yeah, it never worked with PS7

@Karl-WE
Copy link
Contributor Author

Karl-WE commented Oct 3, 2024

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

@jaromirk
Copy link
Collaborator

jaromirk commented Oct 4, 2024

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

@Karl-WE
Copy link
Contributor Author

Karl-WE commented Oct 4, 2024

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?

@michbern-ms
Copy link
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

@jaromirk
Copy link
Collaborator

jaromirk commented Oct 5, 2024

@michbern-ms i added you as admin. Feel free to discuss internally with @machv what's needed. Thank you for your contributions!

@michbern-ms
Copy link
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
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants