microsoft / microsoft/AzureMonitorCommunity

Get-AzContext error when running WorkspaceConfigToDCRMigrationTool.ps1 script

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

Nobody has claimed this yet.

Dominant language
PowerShell
Stars
1.2k
Forks
493
PR merge metrics
No merged PRs in 30d

Description

Hi,

I get the following error when I run the script on Powershell 7.3.4:

Get-AzContext : The term 'Get-AzContext' 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.
At C:\Temp\WorkspaceConfigToDCRMigrationTool.ps1:664 char:18

  • $azContext = Get-AzContext
    
  •              ~~~~~~~~~~~~~
    
    • CategoryInfo : ObjectNotFound: (Get-AzContext:String) [], CommandNotFoundException
    • FullyQualifiedErrorId : CommandNotFoundException

Module Az.Accounts is installed on version 2.12.3 and I run powershell as administrator.

Any ideas?

Best regards,

DJITS

Contributor guide

Open the contributing guide

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 WorkspaceConfigToDCRMigrationTool.ps1 at line 664 and reproduce the command-not-found error in PowerShell 7.3.4 with Az.Accounts 2.12.3 installed. Check how the script expects the Az.Accounts cmdlet to be available; the issue is done when the migration script reaches this call without the Get-AzContext error.

Written by the indexing model from the issue text.

Assessment

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.