Cmdlets

Choose a cmdlet from the list on the left or search for a specific cmdlet. Choose a cmdlet from the list or search for a specific cmdlet.
About Help  Providers
 

Get-AzureStorSimpleResourceContext

Get-AzureStorSimpleResourceContext

microsoft.windowsazure.commands.storsimple.dll

Synopsis

Gets the current resource context.

Syntax

Get-AzureStorSimpleResourceContext [-Profile] [<CommonParameters>]

Detailed Description

The Get-AzureStorSimpleResourceContext cmdlet gets the current resource context.

Parameters

-Profile <Microsoft.Azure.Common.Authentication.Models.AzureProfile>

Specifies an Azure profile.

Aliases

none

Required?

false

Position

named

Default value

none

Accept pipeline input?

false

Accept wildcard characters?

false

Input Type

None

Return Type

StorSimpleResourceContext

Notes

None

Examples

Example 1: Get the current context

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.

PS C:\>Select-AzureStorSimpleResource -ResourceName "Contoso63-Tsqa" 
PS C:\> Get-AzureStorSimpleResourceContext
ResourceId           ResourceName
----------           ------------
1909806764156522689  Contoso63-Tsqa 

Example 2: Attempt to get the current context

This command gets the current context. In this example, no context has been set. The command returns a message that explains the problem.

PS C:\>Get-AzureStorSimpleResourceContext
Get-AzureStorSimpleResourceContext : Resource Context is not set for your subscription. Please use
Select-AzureStorSimpleResource -ResourceName <<name>> to set

Get-AzureStorSimpleResource
Select-AzureStorSimpleResource