-
Notifications
You must be signed in to change notification settings - Fork 4.1k
Open
Labels
Cloud ShellService AttentionThis issue is responsible by Azure service team.This issue is responsible by Azure service team.customer-reported
Description
Description
In Azure Cloud Shell's AzurePSDrive, when you try to invoke a cmdlet without specifying resourcegroup, the cmdlet errors due to multiple values defined in PSDefaultParameterValues
Script/Steps for Reproduction
Navigate to a resourcegroup inside AzurePSDrive and call a Get-AzureRM*cmdlet that takes a resourcegroup parameter
cd Azure:\<subscription name>\ResourceGroups\<resource group name>
Get-AzureRmVpnClientPackage
#Output
WARNING: Multiple different default values are defined in $PSDefaultParameterValues for the
parameter matching the following name or alias: ResourceGroupName. These defaults have been ignored.
cmdlet Get-AzureRmVpnClientPackage at command pipeline position 1
Supply values for the following parameters:
(Type !? for Help.)
ResourceGroupName:Module Version
Get-Module -Name AzureRM -ListAvailable
#Output
Directory: C:\Program Files\WindowsPowerShell\Modules
ModuleType Version Name ExportedCommands
---------- ------- ---- ----------------
Script 5.4.0 AzureRMEnvironment Data
$PSVersionTable
#Output
Name Value
---- -----
PSVersion 5.1.14393.1944
PSEdition Desktop
PSCompatibleVersions {1.0, 2.0, 3.0, 4.0...}
BuildVersion 10.0.14393.1944
CLRVersion 4.0.30319.42000
WSManStackVersion 3.0
PSRemotingProtocolVersion 2.3
SerializationVersion 1.1.0.1Root Cause
AzurePSDrive defines a default value of resourcegroup parameter for *-AzureRM cmdlets
$PSDefaultParameterValues['*-AzureRM*:ResourceGroupName']
#Output
if($pwd -like 'Azure:\*\ResourceGroups\*'){($pwd -split '\\')[3]}Metadata
Metadata
Assignees
Labels
Cloud ShellService AttentionThis issue is responsible by Azure service team.This issue is responsible by Azure service team.customer-reported