< Back
Select-AzureStorSimpleResource
Post
NAME Select-AzureStorSimpleResource
SYNOPSIS
Sets a resource as the current resource.
SYNTAX
Select-AzureStorSimpleResource [-ResourceName] <String> [[-RegistrationKey] <String>] [-Profile
<Microsoft.Azure.Common.Authentication.Models.AzureProfile>] [<CommonParameters>]
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.
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 ... 72346.aspx) on
the Microsoft Developer Network.
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.
Required? true
Position? 2
Default value none
Accept pipeline input? true(ByPropertyName)
Accept wildcard characters? false
<CommonParameters>
This cmdlet supports the common parameters: Verbose, Debug,
ErrorAction, ErrorVariable, WarningAction, WarningVariable,
OutBuffer, PipelineVariable, and OutVariable. For more information, see
about_CommonParameters (https:/go.microsoft.com/fwlink/?LinkID=113216).
INPUTS
None
OUTPUTS
StorSimpleResourceContext
This cmdlet returns a StorSimpleResourceContext object that contains details for the resource context.
NOTES
Keywords: azure, azuresm, servicemanagement, management, service, store, storsimple
Example 1: Select a resource for the first time
PS C:\\>Select-AzureStorSimpleResource -ResourceName "Contoso64-Tsqa" -RegistrationKey "<your registration key>"
ResourceId ResourceName
---------- ------------
1909806764156522689 Contoso64-Tsqa
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.
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
PS C:\\>Select-AzureStorSimpleResource -ResourceName "Contoso64-Tsqa"
ResourceId ResourceName
---------- ------------
1909806764156522689 Contoso64-Tsqa
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.
RELATED LINKS
Get-AzureStorSimpleResource
Get-AzureStorSimpleResourceContext
SYNOPSIS
Sets a resource as the current resource.
SYNTAX
Select-AzureStorSimpleResource [-ResourceName] <String> [[-RegistrationKey] <String>] [-Profile
<Microsoft.Azure.Common.Authentication.Models.AzureProfile>] [<CommonParameters>]
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.
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 ... 72346.aspx) on
the Microsoft Developer Network.
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.
Required? true
Position? 2
Default value none
Accept pipeline input? true(ByPropertyName)
Accept wildcard characters? false
<CommonParameters>
This cmdlet supports the common parameters: Verbose, Debug,
ErrorAction, ErrorVariable, WarningAction, WarningVariable,
OutBuffer, PipelineVariable, and OutVariable. For more information, see
about_CommonParameters (https:/go.microsoft.com/fwlink/?LinkID=113216).
INPUTS
None
OUTPUTS
StorSimpleResourceContext
This cmdlet returns a StorSimpleResourceContext object that contains details for the resource context.
NOTES
Keywords: azure, azuresm, servicemanagement, management, service, store, storsimple
Example 1: Select a resource for the first time
PS C:\\>Select-AzureStorSimpleResource -ResourceName "Contoso64-Tsqa" -RegistrationKey "<your registration key>"
ResourceId ResourceName
---------- ------------
1909806764156522689 Contoso64-Tsqa
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.
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
PS C:\\>Select-AzureStorSimpleResource -ResourceName "Contoso64-Tsqa"
ResourceId ResourceName
---------- ------------
1909806764156522689 Contoso64-Tsqa
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.
RELATED LINKS
Get-AzureStorSimpleResource
Get-AzureStorSimpleResourceContext