microsoft / microsoft/devcenter-catalog

WithRetry : The term 'Install-PowerShell' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again

Open
#116 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
PowerShell
Stars
52
Forks
194
Avg merge
16h 53m
Merged PRs (30d)
1

Description

[2024-12-03T11:02:08.415928+00:00] Installing PowerShell 7
[2024-12-03T11:03:33.963388+00:00] Invoke-RestMethod : Unable to connect to the remote server
[2024-12-03T11:03:33.963547+00:00] At C:\Windows\SystemTemp\d54cbee8-4b8b-46f4-9a40-bbeecf7f79ee\pwpcij52.1jc\main.ps1:127 char:17
[2024-12-03T11:03:33.963553+00:00] + ... $code = Invoke-RestMethod -Uri https://aka.ms/install-powershell. ...
[2024-12-03T11:03:33.963554+00:00] + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
[2024-12-03T11:03:33.963559+00:00] + CategoryInfo : InvalidOperation: (System.Net.HttpWebRequest:HttpWebRequest) [Invoke-RestMethod], WebExc
[2024-12-03T11:03:33.963566+00:00] eption
[2024-12-03T11:03:33.963570+00:00] + FullyQualifiedErrorId : WebCmdletWebResponseException,Microsoft.PowerShell.Commands.InvokeRestMethodCommand
[2024-12-03T11:03:33.963572+00:00]
[2024-12-03T11:03:34.048223+00:00] New-Item : Cannot process argument because the value of argument "value" is null. Change the value of argument "value"
[2024-12-03T11:03:34.048450+00:00] to a non-null value.
[2024-12-03T11:03:34.048458+00:00] At C:\Windows\SystemTemp\d54cbee8-4b8b-46f4-9a40-bbeecf7f79ee\pwpcij52.1jc\main.ps1:128 char:17
[2024-12-03T11:03:34.048460+00:00] + ... $null = New-Item -Path function:Install-PowerShell -Value $code
[2024-12-03T11:03:34.048494+00:00] + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
[2024-12-03T11:03:34.048500+00:00] + CategoryInfo : InvalidArgument: (Install-PowerShell:String) [New-Item], PSArgumentNullException
[2024-12-03T11:03:34.048506+00:00] + FullyQualifiedErrorId : NewItemValueNotSpecified,Microsoft.PowerShell.Commands.NewItemCommand
[2024-12-03T11:03:34.048512+00:00]
[2024-12-03T11:03:34.128947+00:00] WithRetry : The term 'Install-PowerShell' is not recognized as the name of a cmdlet, function, script file, or
[2024-12-03T11:03:34.129015+00:00] operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try
[2024-12-03T11:03:34.129038+00:00] again.

Note - we have allowed the required network for devbox subnet, but still the customizing failed, please advise.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with main.ps1 around lines 127-128, where the script retrieves https://aka.ms/install-powershell and creates Install-PowerShell. Check why Invoke-RestMethod cannot connect and why the resulting null value prevents the function from being created. Done means DevBox customization completes with Install-PowerShell available.

Written by the indexing model from the issue text.

Assessment

Tech stack
powershell
Domain
cloud
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.