Get-AzureStorSimpleResourceContext
Gets the current resource context.
Note
The cmdlets referenced in this documentation are for managing legacy Azure resources that use Azure Service Manager (ASM) APIs. This legacy PowerShell module isn't recommended when creating new resources since ASM is scheduled for retirement. For more information, see Azure Service Manager retirement.
The Az PowerShell module is the recommended PowerShell module for managing Azure Resource Manager (ARM) resources with PowerShell.
Syntax
Default (Default)
Get-AzureStorSimpleResourceContext
[-Profile <AzureSMProfile>]
[<CommonParameters>]
Description
The Get-AzureStorSimpleResourceContext cmdlet gets the current resource context.
Examples
Example 1: Get the current context
PS C:\>Select-AzureStorSimpleResource -ResourceName "Contoso63-Tsqa"
PS C:\> Get-AzureStorSimpleResourceContext
ResourceId ResourceName
---------- ------------
1909806764156522689 Contoso63-Tsqa
The first command sets the current context to be the resource named Contoso63-Tsqa by using the Select-AzureStorSimpleResource cmdlet.
The second command gets the current resource context.
Example 2: Attempt to get the current context
PS C:\>Get-AzureStorSimpleResourceContext
Get-AzureStorSimpleResourceContext : Resource Context is not set for your subscription. Please use
Select-AzureStorSimpleResource -ResourceName <<name>> to set
This command gets the current context. In this example, no context has been set. The command returns a message that explains the problem.
Parameters
-Profile
Specifies an Azure profile.
Parameter properties
Type: | AzureSMProfile |
Default value: | None |
Supports wildcards: | False |
DontShow: | False |
Parameter sets
(All)
Position: | Named |
Mandatory: | False |
Value from pipeline: | False |
Value from pipeline by property name: | False |
Value from remaining arguments: | False |
CommonParameters
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutBuffer, -OutVariable, -PipelineVariable, -ProgressAction, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters.
Inputs
None
Outputs
StorSimpleResourceContext
This cmdlet returns a ResourceContext object.