microsoft / microsoft/AzureMonitorCommunity
Get-AzContext error when running WorkspaceConfigToDCRMigrationTool.ps1 script
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
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- 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