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
 

Select-AzureStorSimpleResource

Select-AzureStorSimpleResource

microsoft.windowsazure.commands.storsimple.dll

Synopsis

Sets a resource as the current resource.

Syntax

Select-AzureStorSimpleResource [-ResourceName] [-RegistrationKey] [-Profile] [<CommonParameters>]

Detailed Description

The Select-AzureStorSimpleResource cmdlet sets a resource as the current resource. After you select a resource, other cmdlets apply within that 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

-RegistrationKey <String>

Specifies a registration key. Specify a key the first time that you select a resource. After this cmdlet selects the current resource, cmdlets use this key, as required. For more information, see Get the service registration key (http://msdn.microsoft.com/en-us/library/azure/dn772346.aspx) on the Microsoft Developer Network.

Aliases

none

Required?

false

Position

3

Default value

none

Accept pipeline input?

true (ByPropertyName)

Accept wildcard characters?

false

-ResourceName <String>

Specifies the name of the resource to select as the current resource.

Aliases

none

Required?

true

Position

2

Default value

none

Accept pipeline input?

true(ByPropertyName)

Accept wildcard characters?

false

Input Type

None

Return Type

StorSimpleResourceContext

Notes

None

Examples

Example 1: Select a resource for the first time

This command selects the resource named Contoso64-Tsqa as the current context. In this example, the computer has not had this context initialized previously, and, therefore, you must specify a value for the RegistrationKey parameter.

PS C:\>Select-AzureStorSimpleResource -ResourceName "Contoso64-Tsqa" -RegistrationKey "<your registration key>"
ResourceId           ResourceName
----------           ------------
1909806764156522689  Contoso64-Tsqa 

Example 2: Attempt to select a resource

This command gets the current context for this computer by using the Get-AzureStorSimpleResourceContext cmdlet. The current selected resource is Contoso64-Tsqa. This is consistent with the previous example. 
PS C:\>Get-AzureStorSimpleResourceContext
ResourceId           ResourceName
----------           ------------
1909806764156522689  Contoso64-Tsqa 

This command attempts to reset the resource to be Contoso02-Resource. For this example, this resource has not been previously selected. The registration key is not saved or included in the command. The command cannot select the resource. 
PS C:\>Select-AzureStorSimpleResource -ResourceName "Contoso02-Resource"
Select-AzureStorSimpleResource : Could not find the persisted secret. Please use Select-AzureStorSimpleResource and
provide the Registration key once again.

Example 3: Select a previously selected resource

This command selects the resource named Contoso64-Tsqa as the current context. In this example, that context has previously been selected, and, therefore, you do not need to specify a value for the RegistrationKey parameter.

PS C:\>Select-AzureStorSimpleResource -ResourceName "Contoso64-Tsqa"
ResourceId           ResourceName
----------           ------------
1909806764156522689  Contoso64-Tsqa

Get-AzureStorSimpleResource
Get-AzureStorSimpleResourceContext