diff --git a/src/StorageDiscovery/StorageDiscovery.Autorest/.gitattributes b/src/StorageDiscovery/StorageDiscovery.Autorest/.gitattributes new file mode 100644 index 000000000000..2125666142eb --- /dev/null +++ b/src/StorageDiscovery/StorageDiscovery.Autorest/.gitattributes @@ -0,0 +1 @@ +* text=auto \ No newline at end of file diff --git a/src/StorageDiscovery/StorageDiscovery.Autorest/.gitignore b/src/StorageDiscovery/StorageDiscovery.Autorest/.gitignore new file mode 100644 index 000000000000..6ec158bd9768 --- /dev/null +++ b/src/StorageDiscovery/StorageDiscovery.Autorest/.gitignore @@ -0,0 +1,16 @@ +bin +obj +.vs +generated +internal +exports +tools +test/*-TestResults.xml +license.txt +/*.ps1 +/*.psd1 +/*.ps1xml +/*.psm1 +/*.snk +/*.csproj +/*.nuspec \ No newline at end of file diff --git a/src/StorageDiscovery/StorageDiscovery.Autorest/Properties/AssemblyInfo.cs b/src/StorageDiscovery/StorageDiscovery.Autorest/Properties/AssemblyInfo.cs new file mode 100644 index 000000000000..21129398b69a --- /dev/null +++ b/src/StorageDiscovery/StorageDiscovery.Autorest/Properties/AssemblyInfo.cs @@ -0,0 +1,30 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the Apache License, Version 2.0 (the ""License""); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an ""AS IS"" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// Code generated by Microsoft (R) AutoRest Code Generator.Changes may cause incorrect behavior and will be lost if the code +// is regenerated. + +using System; +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +[assembly: System.Reflection.AssemblyCompanyAttribute("Microsoft")] +[assembly: System.Reflection.AssemblyCopyrightAttribute("Copyright © Microsoft")] +[assembly: System.Reflection.AssemblyProductAttribute("Microsoft Azure PowerShell")] +[assembly: System.Reflection.AssemblyTitleAttribute("Microsoft Azure PowerShell - StorageDiscoveryClient")] +[assembly: System.Reflection.AssemblyFileVersionAttribute("0.1.0")] +[assembly: System.Reflection.AssemblyVersionAttribute("0.1.0")] +[assembly: System.Runtime.InteropServices.ComVisibleAttribute(false)] +[assembly: System.CLSCompliantAttribute(false)] + diff --git a/src/StorageDiscovery/StorageDiscovery.Autorest/README.md b/src/StorageDiscovery/StorageDiscovery.Autorest/README.md new file mode 100644 index 000000000000..ee51967c746f --- /dev/null +++ b/src/StorageDiscovery/StorageDiscovery.Autorest/README.md @@ -0,0 +1,24 @@ + +# Az.StorageDiscovery +This directory contains the PowerShell module for the StorageDiscovery service. + +--- +## Info +- Modifiable: yes +- Generated: all +- Committed: yes +- Packaged: yes + +--- +## Detail +This module was primarily generated via [AutoRest](https://github.com/Azure/autorest) using the [PowerShell](https://github.com/Azure/autorest.powershell) extension. + +## Module Requirements +- [Az.Accounts module](https://www.powershellgallery.com/packages/Az.Accounts/), version 2.7.5 or greater + +## Authentication +AutoRest does not generate authentication code for the module. Authentication is handled via Az.Accounts by altering the HTTP payload before it is sent. + +## Development +For information on how to develop for `Az.StorageDiscovery`, see [how-to.md](how-to.md). + diff --git a/src/StorageDiscovery/StorageDiscovery.Autorest/UX/Microsoft.StorageDiscovery/storageDiscoveryWorkspaces.json b/src/StorageDiscovery/StorageDiscovery.Autorest/UX/Microsoft.StorageDiscovery/storageDiscoveryWorkspaces.json new file mode 100644 index 000000000000..2c2e7c764a9e --- /dev/null +++ b/src/StorageDiscovery/StorageDiscovery.Autorest/UX/Microsoft.StorageDiscovery/storageDiscoveryWorkspaces.json @@ -0,0 +1,85 @@ +{ + "resourceType": "storageDiscoveryWorkspaces", + "apiVersion": "2025-06-01-preview", + "learnMore": { + "url": "https://learn.microsoft.com/powershell/module/az.storagediscovery" + }, + "commands": [ + { + "name": "Get-AzStorageDiscoveryWorkspace", + "description": "Get a StorageDiscoveryWorkspace", + "path": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorageDiscovery/storageDiscoveryWorkspaces/{storageDiscoveryWorkspaceName}", + "help": { + "learnMore": { + "url": "https://learn.microsoft.com/powershell/module/az.storagediscovery/get-azstoragediscoveryworkspace" + }, + "parameterSets": [ + { + "parameters": [ + "-Name ", + "-ResourceGroupName ", + "[-SubscriptionId ]" + ] + } + ] + }, + "examples": [ + { + "description": "Get a StorageDiscoveryWorkspace", + "parameters": [ + { + "name": "-Name", + "value": "[Path.storageDiscoveryWorkspaceName]" + }, + { + "name": "-ResourceGroupName", + "value": "[Path.resourceGroupName]" + }, + { + "name": "-SubscriptionId", + "value": "[Path.subscriptionId]" + } + ] + } + ] + }, + { + "name": "Remove-AzStorageDiscoveryWorkspace", + "description": "Delete a StorageDiscoveryWorkspace", + "path": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorageDiscovery/storageDiscoveryWorkspaces/{storageDiscoveryWorkspaceName}", + "help": { + "learnMore": { + "url": "https://learn.microsoft.com/powershell/module/az.storagediscovery/remove-azstoragediscoveryworkspace" + }, + "parameterSets": [ + { + "parameters": [ + "-Name ", + "-ResourceGroupName ", + "[-SubscriptionId ]" + ] + } + ] + }, + "examples": [ + { + "description": "Delete a StorageDiscoveryWorkspace", + "parameters": [ + { + "name": "-Name", + "value": "[Path.storageDiscoveryWorkspaceName]" + }, + { + "name": "-ResourceGroupName", + "value": "[Path.resourceGroupName]" + }, + { + "name": "-SubscriptionId", + "value": "[Path.subscriptionId]" + } + ] + } + ] + } + ] +} diff --git a/src/StorageDiscovery/StorageDiscovery.Autorest/custom/Az.StorageDiscovery.custom.psm1 b/src/StorageDiscovery/StorageDiscovery.Autorest/custom/Az.StorageDiscovery.custom.psm1 new file mode 100644 index 000000000000..82d954431076 --- /dev/null +++ b/src/StorageDiscovery/StorageDiscovery.Autorest/custom/Az.StorageDiscovery.custom.psm1 @@ -0,0 +1,17 @@ +# region Generated + # Load the private module dll + $null = Import-Module -PassThru -Name (Join-Path $PSScriptRoot '..\bin\Az.StorageDiscovery.private.dll') + + # Load the internal module + $internalModulePath = Join-Path $PSScriptRoot '..\internal\Az.StorageDiscovery.internal.psm1' + if(Test-Path $internalModulePath) { + $null = Import-Module -Name $internalModulePath + } + + # Export nothing to clear implicit exports + Export-ModuleMember + + # Export script cmdlets + Get-ChildItem -Path $PSScriptRoot -Recurse -Include '*.ps1' -File | ForEach-Object { . $_.FullName } + Export-ModuleMember -Function (Get-ScriptCmdlet -ScriptFolder $PSScriptRoot) -Alias (Get-ScriptCmdlet -ScriptFolder $PSScriptRoot -AsAlias) +# endregion diff --git a/src/StorageDiscovery/StorageDiscovery.Autorest/custom/README.md b/src/StorageDiscovery/StorageDiscovery.Autorest/custom/README.md new file mode 100644 index 000000000000..fa109dce8481 --- /dev/null +++ b/src/StorageDiscovery/StorageDiscovery.Autorest/custom/README.md @@ -0,0 +1,41 @@ +# Custom +This directory contains custom implementation for non-generated cmdlets for the `Az.StorageDiscovery` module. Both scripts (`.ps1`) and C# files (`.cs`) can be implemented here. They will be used during the build process in `build-module.ps1`, and create cmdlets into the `..\exports` folder. The only generated file into this folder is the `Az.StorageDiscovery.custom.psm1`. This file should not be modified. + +## Info +- Modifiable: yes +- Generated: partial +- Committed: yes +- Packaged: yes + +## Details +For `Az.StorageDiscovery` to use custom cmdlets, it does this two different ways. We **highly recommend** creating script cmdlets, as they are easier to write and allow access to the other exported cmdlets. C# cmdlets *cannot access exported cmdlets*. + +For C# cmdlets, they are compiled with the rest of the generated low-level cmdlets into the `./bin/Az.StorageDiscovery.private.dll`. The names of the cmdlets (methods) and files must follow the `[cmdletName]_[variantName]` syntax used for generated cmdlets. The `variantName` is used as the `ParameterSetName`, so use something appropriate that doesn't clash with already created variant or parameter set names. You cannot use the `ParameterSetName` property in the `Parameter` attribute on C# cmdlets. Each cmdlet must be separated into variants using the same pattern as seen in the `generated/cmdlets` folder. + +For script cmdlets, these are loaded via the `Az.StorageDiscovery.custom.psm1`. Then, during the build process, this module is loaded and processed in the same manner as the C# cmdlets. The fundamental difference is the script cmdlets use the `ParameterSetName` attribute and C# cmdlets do not. To create a script cmdlet variant of a generated cmdlet, simply decorate all parameters in the script with the new `ParameterSetName` in the `Parameter` attribute. This will appropriately treat each parameter set as a separate variant when processed to be exported during the build. + +## Purpose +This allows the modules to have cmdlets that were not defined in the REST specification. It also allows combining logic using generated cmdlets. This is a level of customization beyond what can be done using the [readme configuration options](https://github.com/Azure/autorest/blob/master/docs/powershell/options.md) that are currently available. These custom cmdlets are then referenced by the cmdlets created at build-time in the `..\exports` folder. + +## Usage +The easiest way currently to start developing custom cmdlets is to copy an existing cmdlet. For C# cmdlets, copy one from the `generated/cmdlets` folder. For script cmdlets, build the project using `build-module.ps1` and copy one of the scripts from the `..\exports` folder. After that, if you want to add new parameter sets, follow the guidelines in the `Details` section above. For implementing a new cmdlets, at minimum, please keep these parameters: +- Break +- DefaultProfile +- HttpPipelineAppend +- HttpPipelinePrepend +- Proxy +- ProxyCredential +- ProxyUseDefaultCredentials + +These provide functionality to our HTTP pipeline and other useful features. In script, you can forward these parameters using `$PSBoundParameters` to the other cmdlets you're calling within `Az.StorageDiscovery`. For C#, follow the usage seen in the `ProcessRecordAsync` method. + +### Attributes +For processing the cmdlets, we've created some additional attributes: +- `Microsoft.Azure.PowerShell.Cmdlets.StorageDiscovery.DescriptionAttribute` + - Used in C# cmdlets to provide a high-level description of the cmdlet. This is propagated to reference documentation via [help comments](https://learn.microsoft.com/powershell/module/microsoft.powershell.core/about/about_comment_based_help) in the exported scripts. +- `Microsoft.Azure.PowerShell.Cmdlets.StorageDiscovery.DoNotExportAttribute` + - Used in C# and script cmdlets to suppress creating an exported cmdlet at build-time. These cmdlets will *not be exposed* by `Az.StorageDiscovery`. +- `Microsoft.Azure.PowerShell.Cmdlets.StorageDiscovery.InternalExportAttribute` + - Used in C# cmdlets to route exported cmdlets to the `..\internal`, which are *not exposed* by `Az.StorageDiscovery`. For more information, see [README.md](..\internal/README.md) in the `..\internal` folder. +- `Microsoft.Azure.PowerShell.Cmdlets.StorageDiscovery.ProfileAttribute` + - Used in C# and script cmdlets to define which Azure profiles the cmdlet supports. This is only supported for Azure (`--azure`) modules. \ No newline at end of file diff --git a/src/StorageDiscovery/StorageDiscovery.Autorest/custom/autogen-model-cmdlets/New-AzStorageDiscoveryScopeObject.ps1 b/src/StorageDiscovery/StorageDiscovery.Autorest/custom/autogen-model-cmdlets/New-AzStorageDiscoveryScopeObject.ps1 new file mode 100644 index 000000000000..8bd0b722f189 --- /dev/null +++ b/src/StorageDiscovery/StorageDiscovery.Autorest/custom/autogen-model-cmdlets/New-AzStorageDiscoveryScopeObject.ps1 @@ -0,0 +1,67 @@ + +# ---------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# http://www.apache.org/licenses/LICENSE-2.0 +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# Code generated by Microsoft (R) AutoRest Code Generator.Changes may cause incorrect behavior and will be lost if the code +# is regenerated. +# ---------------------------------------------------------------------------------- + +<# +.Synopsis +Create an in-memory object for StorageDiscoveryScope. +.Description +Create an in-memory object for StorageDiscoveryScope. + +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.StorageDiscovery.Models.StorageDiscoveryScope +.Link +https://learn.microsoft.com/powershell/module/Az.StorageDiscovery/new-azstoragediscoveryscopeobject +#> +function New-AzStorageDiscoveryScopeObject { + [Microsoft.Azure.PowerShell.Cmdlets.StorageDiscovery.ModelCmdletAttribute()] + [OutputType('Microsoft.Azure.PowerShell.Cmdlets.StorageDiscovery.Models.StorageDiscoveryScope')] + [CmdletBinding(PositionalBinding=$false)] + Param( + + [Parameter(Mandatory, HelpMessage="Display name of the collection.")] + [string] + $DisplayName, + [Parameter(Mandatory, HelpMessage="Resource types for the collection.")] + [Microsoft.Azure.PowerShell.Cmdlets.StorageDiscovery.PSArgumentCompleterAttribute("Microsoft.Storage/storageAccounts")] + [string[]] + $ResourceType, + [Parameter(HelpMessage="Resource tags.")] + [Microsoft.Azure.PowerShell.Cmdlets.StorageDiscovery.Models.ITags] + $Tag, + [Parameter(HelpMessage="The storage account tags keys to filter.")] + [string[]] + $TagKeysOnly + ) + + process { + $Object = [Microsoft.Azure.PowerShell.Cmdlets.StorageDiscovery.Models.StorageDiscoveryScope]::New() + + if ($PSBoundParameters.ContainsKey('DisplayName')) { + $Object.DisplayName = $DisplayName + } + if ($PSBoundParameters.ContainsKey('ResourceType')) { + $Object.ResourceType = $ResourceType + } + if ($PSBoundParameters.ContainsKey('Tag')) { + $Object.Tag = $Tag + } + if ($PSBoundParameters.ContainsKey('TagKeysOnly')) { + $Object.TagKeysOnly = $TagKeysOnly + } + return $Object + } +} + diff --git a/src/StorageDiscovery/StorageDiscovery.Autorest/docs/Az.StorageDiscovery.md b/src/StorageDiscovery/StorageDiscovery.Autorest/docs/Az.StorageDiscovery.md new file mode 100644 index 000000000000..be8e35b604a1 --- /dev/null +++ b/src/StorageDiscovery/StorageDiscovery.Autorest/docs/Az.StorageDiscovery.md @@ -0,0 +1,28 @@ +--- +Module Name: Az.StorageDiscovery +Module Guid: d88ebaf3-95a8-4142-a582-f2526d777a7c +Download Help Link: https://learn.microsoft.com/powershell/module/az.storagediscovery +Help Version: 1.0.0.0 +Locale: en-US +--- + +# Az.StorageDiscovery Module +## Description +Microsoft Azure PowerShell: StorageDiscovery cmdlets + +## Az.StorageDiscovery Cmdlets +### [Get-AzStorageDiscoveryWorkspace](Get-AzStorageDiscoveryWorkspace.md) +Get a StorageDiscoveryWorkspace + +### [New-AzStorageDiscoveryScopeObject](New-AzStorageDiscoveryScopeObject.md) +Create an in-memory object for StorageDiscoveryScope. + +### [New-AzStorageDiscoveryWorkspace](New-AzStorageDiscoveryWorkspace.md) +Create a StorageDiscoveryWorkspace + +### [Remove-AzStorageDiscoveryWorkspace](Remove-AzStorageDiscoveryWorkspace.md) +Delete a StorageDiscoveryWorkspace + +### [Update-AzStorageDiscoveryWorkspace](Update-AzStorageDiscoveryWorkspace.md) +Update a StorageDiscoveryWorkspace + diff --git a/src/StorageDiscovery/StorageDiscovery.Autorest/docs/Get-AzStorageDiscoveryWorkspace.md b/src/StorageDiscovery/StorageDiscovery.Autorest/docs/Get-AzStorageDiscoveryWorkspace.md new file mode 100644 index 000000000000..e5450d3a843c --- /dev/null +++ b/src/StorageDiscovery/StorageDiscovery.Autorest/docs/Get-AzStorageDiscoveryWorkspace.md @@ -0,0 +1,249 @@ +--- +external help file: +Module Name: Az.StorageDiscovery +online version: https://learn.microsoft.com/powershell/module/az.storagediscovery/get-azstoragediscoveryworkspace +schema: 2.0.0 +--- + +# Get-AzStorageDiscoveryWorkspace + +## SYNOPSIS +Get a StorageDiscoveryWorkspace + +## SYNTAX + +### List1 (Default) +``` +Get-AzStorageDiscoveryWorkspace [-SubscriptionId ] [-DefaultProfile ] [] +``` + +### Get +``` +Get-AzStorageDiscoveryWorkspace -Name -ResourceGroupName [-SubscriptionId ] + [-DefaultProfile ] [] +``` + +### GetViaIdentity +``` +Get-AzStorageDiscoveryWorkspace -InputObject [-DefaultProfile ] + [] +``` + +### List +``` +Get-AzStorageDiscoveryWorkspace -ResourceGroupName [-SubscriptionId ] + [-DefaultProfile ] [] +``` + +## DESCRIPTION +Get a StorageDiscoveryWorkspace + +## EXAMPLES + +### Example 1: Get a workspace properties +```powershell +Get-AzStorageDiscoveryWorkspace -Name $workSpaceName -ResourceGroupName $ResourceGroupName +``` + +```output +Description : test workSpace +Id : /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myresourcegroup/providers/Microsoft.StorageDiscovery/storageDiscoveryWorkspaces/myworkspace +Location : eastus2euap +Name : myworkspace +ProvisioningState : Succeeded +ResourceGroupName : myresourcegroup +Scope : {{ + "displayName": "scope1", + "resourceTypes": [ "Microsoft.Storage/storageAccounts" ], + "tagKeysOnly": [ "key1" ], + "tags": { + "tag1": "value1", + "tag2": "value2" + } + }} +Sku : Standard +SystemDataCreatedAt : 7/24/2025 3:30:02 AM +SystemDataCreatedBy : user@microsoft.com +SystemDataCreatedByType : User +SystemDataLastModifiedAt : 7/24/2025 3:30:02 AM +SystemDataLastModifiedBy : user@microsoft.com +SystemDataLastModifiedByType : User +Tag : { + } +Type : microsoft.storagediscovery/storagediscoveryworkspaces +WorkspaceRoot : {/subscriptions/00000000-0000-0000-0000-000000000000} +``` + +The command gets a single workSpace properties with resource group name and workspace name. + +### Example 2: List workspace from subscription +```powershell + Get-AzStorageDiscoveryWorkspace +``` + +```output +Location Name SystemDataCreatedAt SystemDataCreatedBy SystemDataCreatedByType SystemDataLastModifiedAt SystemDataLastModifiedBy SystemDataLastModifiedByType ResourceGroupName +-------- ---- ------------------- ------------------- ----------------------- ------------------------ ------------------------ ---------------------------- ----------------- +eastus2 myworkspace 7/22/2025 10:37:51 AM user@microsoft.com User 7/22/2025 10:37:51 AM user@microsoft.com User myresourcegroup +eastus2 myworkspace2 7/24/2025 3:30:02 AM user@microsoft.com User 7/24/2025 3:42:49 AM user@microsoft.com User myresourcegroup2 +``` + +The command lists workSpaces from the current subscription. + +### Example 3: List workspace from resource group +```powershell + Get-AzStorageDiscoveryWorkspace -ResourceGroupName $ResourceGroupName |fl +``` + +```output +Description : test workSpace +Id : /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myresourcegroup/providers/Microsoft.StorageDiscovery/storageDiscoveryWorkspaces/myworkspace +Location : eastus2euap +Name : myworkspace +ProvisioningState : Succeeded +ResourceGroupName : myresourcegroup +Scope : {{ + "displayName": "scope1", + "resourceTypes": [ "Microsoft.Storage/storageAccounts" ], + "tagKeysOnly": [ "key1" ], + "tags": { + "tag1": "value1", + "tag2": "value2" + } + }} +Sku : Standard +SystemDataCreatedAt : 7/24/2025 3:30:02 AM +SystemDataCreatedBy : user@microsoft.com +SystemDataCreatedByType : User +SystemDataLastModifiedAt : 7/24/2025 3:30:02 AM +SystemDataLastModifiedBy : user@microsoft.com +SystemDataLastModifiedByType : User +Tag : { + } +Type : microsoft.storagediscovery/storagediscoveryworkspaces +WorkspaceRoot : {/subscriptions/00000000-0000-0000-0000-000000000000} + +Description : test workSpace2 +Id : /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myresourcegroup/providers/Microsoft.StorageDiscovery/storageDiscoveryWorkspaces/myworkspace2 +Location : eastus2euap +Name : myworkspace2 +ProvisioningState : Succeeded +ResourceGroupName : myresourcegroup +Scope : {{ + "displayName": "scope2", + "resourceTypes": [ "Microsoft.Storage/storageAccounts" ], + "tagKeysOnly": [ "key2" ], + "tags": { + "tag1": "value1" + } + }} +Sku : Standard +SystemDataCreatedAt : 7/24/2025 3:31:04 AM +SystemDataCreatedBy : user@microsoft.com +SystemDataCreatedByType : User +SystemDataLastModifiedAt : 7/24/2025 3:31:04 AM +SystemDataLastModifiedBy : user@microsoft.com +SystemDataLastModifiedByType : User +Tag : { + } +Type : microsoft.storagediscovery/storagediscoveryworkspaces +WorkspaceRoot : {/subscriptions/00000000-0000-0000-0000-000000000000,/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myresourcegroup} +``` + +The command lists workSpaces from a resource group, and format the output as list. + +## PARAMETERS + +### -DefaultProfile +The DefaultProfile parameter is not functional. +Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. + +```yaml +Type: System.Management.Automation.PSObject +Parameter Sets: (All) +Aliases: AzureRMContext, AzureCredential + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -InputObject +Identity Parameter + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.StorageDiscovery.Models.IStorageDiscoveryIdentity +Parameter Sets: GetViaIdentity +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: True (ByValue) +Accept wildcard characters: False +``` + +### -Name +The name of the StorageDiscoveryWorkspace + +```yaml +Type: System.String +Parameter Sets: Get +Aliases: StorageDiscoveryWorkspaceName + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ResourceGroupName +The name of the resource group. +The name is case insensitive. + +```yaml +Type: System.String +Parameter Sets: Get, List +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -SubscriptionId +The ID of the target subscription. +The value must be an UUID. + +```yaml +Type: System.String[] +Parameter Sets: Get, List, List1 +Aliases: + +Required: False +Position: Named +Default value: (Get-AzContext).Subscription.Id +Accept pipeline input: False +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.StorageDiscovery.Models.IStorageDiscoveryIdentity + +## OUTPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.StorageDiscovery.Models.IStorageDiscoveryWorkspace + +## NOTES + +## RELATED LINKS + diff --git a/src/StorageDiscovery/StorageDiscovery.Autorest/docs/New-AzStorageDiscoveryScopeObject.md b/src/StorageDiscovery/StorageDiscovery.Autorest/docs/New-AzStorageDiscoveryScopeObject.md new file mode 100644 index 000000000000..3b979a57f26c --- /dev/null +++ b/src/StorageDiscovery/StorageDiscovery.Autorest/docs/New-AzStorageDiscoveryScopeObject.md @@ -0,0 +1,136 @@ +--- +external help file: +Module Name: Az.StorageDiscovery +online version: https://learn.microsoft.com/powershell/module/Az.StorageDiscovery/new-azstoragediscoveryscopeobject +schema: 2.0.0 +--- + +# New-AzStorageDiscoveryScopeObject + +## SYNOPSIS +Create an in-memory object for StorageDiscoveryScope. + +## SYNTAX + +``` +New-AzStorageDiscoveryScopeObject -DisplayName -ResourceType [-Tag ] + [-TagKeysOnly ] [] +``` + +## DESCRIPTION +Create an in-memory object for StorageDiscoveryScope. + +## EXAMPLES + +### Example 1: Create a workspace with discovery scope object +```powershell +$scope1 = New-AzStorageDiscoveryScopeObject -DisplayName "scope1" -ResourceType "Microsoft.Storage/storageAccounts" -TagKeysOnly "key1" -Tag @{"tag1" = "value1"; "tag2" = "value2" } +New-AzStorageDiscoveryWorkspace -Name $workSpaceName -ResourceGroupName $ResourceGroupName -Location $location -WorkspaceRoot $DiscoveryScopeLevel -Sku Standard -Scope $scope1 -Description "test workSpace" +``` + +```output +Description : test workSpace +Id : /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myresourcegroup/providers/Microsoft.StorageDiscovery/storageDiscoveryWorkspaces/myworkspace +Location : eastus2euap +Name : myworkspace +ProvisioningState : Succeeded +ResourceGroupName : myresourcegroup +Scope : {{ + "displayName": "scope1", + "resourceTypes": [ "Microsoft.Storage/storageAccounts" ], + "tagKeysOnly": [ "key1" ], + "tags": { + "tag1": "value1", + "tag2": "value2" + } + }} +Sku : Standard +SystemDataCreatedAt : 7/24/2025 3:30:02 AM +SystemDataCreatedBy : user@microsoft.com +SystemDataCreatedByType : User +SystemDataLastModifiedAt : 7/24/2025 3:30:02 AM +SystemDataLastModifiedBy : user@microsoft.com +SystemDataLastModifiedByType : User +Tag : { + } +Type : microsoft.storagediscovery/storagediscoveryworkspaces +WorkspaceRoot : {/subscriptions/00000000-0000-0000-0000-000000000000} +``` + +The first command creates a discovery scope object, then the second command creates a workspace with the discovery scope object. + +## PARAMETERS + +### -DisplayName +Display name of the collection. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ResourceType +Resource types for the collection. + +```yaml +Type: System.String[] +Parameter Sets: (All) +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Tag +Resource tags. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.StorageDiscovery.Models.ITags +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -TagKeysOnly +The storage account tags keys to filter. + +```yaml +Type: System.String[] +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +## OUTPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.StorageDiscovery.Models.StorageDiscoveryScope + +## NOTES + +## RELATED LINKS + diff --git a/src/StorageDiscovery/StorageDiscovery.Autorest/docs/New-AzStorageDiscoveryWorkspace.md b/src/StorageDiscovery/StorageDiscovery.Autorest/docs/New-AzStorageDiscoveryWorkspace.md new file mode 100644 index 000000000000..6eeaa87f3240 --- /dev/null +++ b/src/StorageDiscovery/StorageDiscovery.Autorest/docs/New-AzStorageDiscoveryWorkspace.md @@ -0,0 +1,305 @@ +--- +external help file: +Module Name: Az.StorageDiscovery +online version: https://learn.microsoft.com/powershell/module/az.storagediscovery/new-azstoragediscoveryworkspace +schema: 2.0.0 +--- + +# New-AzStorageDiscoveryWorkspace + +## SYNOPSIS +Create a StorageDiscoveryWorkspace + +## SYNTAX + +### CreateExpanded (Default) +``` +New-AzStorageDiscoveryWorkspace -Name -ResourceGroupName -Location + [-SubscriptionId ] [-Description ] [-Scope ] [-Sku ] + [-Tag ] [-WorkspaceRoot ] [-DefaultProfile ] [-Confirm] [-WhatIf] + [] +``` + +### CreateViaJsonFilePath +``` +New-AzStorageDiscoveryWorkspace -Name -ResourceGroupName -JsonFilePath + [-SubscriptionId ] [-DefaultProfile ] [-Confirm] [-WhatIf] [] +``` + +### CreateViaJsonString +``` +New-AzStorageDiscoveryWorkspace -Name -ResourceGroupName -JsonString + [-SubscriptionId ] [-DefaultProfile ] [-Confirm] [-WhatIf] [] +``` + +## DESCRIPTION +Create a StorageDiscoveryWorkspace + +## EXAMPLES + +### Example 1: Create a workspace +```powershell +$scope1 = New-AzStorageDiscoveryScopeObject -DisplayName "scope1" -ResourceType "Microsoft.Storage/storageAccounts" -TagKeysOnly "key1" -Tag @{"tag1" = "value1"; "tag2" = "value2" } +New-AzStorageDiscoveryWorkspace -Name $workSpaceName -ResourceGroupName $ResourceGroupName -Location $location -WorkspaceRoot $DiscoveryScopeLevel -Sku Standard -Scope $scope1 -Description "test workSpace" +``` + +```output +Description : test workSpace +Id : /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myresourcegroup/providers/Microsoft.StorageDiscovery/storageDiscoveryWorkspaces/myworkspace +Location : eastus2euap +Name : myworkspace +ProvisioningState : Succeeded +ResourceGroupName : myresourcegroup +Scope : {{ + "displayName": "scope1", + "resourceTypes": [ "Microsoft.Storage/storageAccounts" ], + "tagKeysOnly": [ "key1" ], + "tags": { + "tag1": "value1", + "tag2": "value2" + } + }} +Sku : Standard +SystemDataCreatedAt : 7/24/2025 3:30:02 AM +SystemDataCreatedBy : user@microsoft.com +SystemDataCreatedByType : User +SystemDataLastModifiedAt : 7/24/2025 3:30:02 AM +SystemDataLastModifiedBy : user@microsoft.com +SystemDataLastModifiedByType : User +Tag : { + } +Type : microsoft.storagediscovery/storagediscoveryworkspaces +WorkspaceRoot : {/subscriptions/00000000-0000-0000-0000-000000000000} +``` + +The first command creates a discovery scope object, then the second command creates a workspace with the discovery scope object. + +## PARAMETERS + +### -DefaultProfile +The DefaultProfile parameter is not functional. +Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. + +```yaml +Type: System.Management.Automation.PSObject +Parameter Sets: (All) +Aliases: AzureRMContext, AzureCredential + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Description +The description of the storage discovery workspace + +```yaml +Type: System.String +Parameter Sets: CreateExpanded +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -JsonFilePath +Path of Json file supplied to the Create operation + +```yaml +Type: System.String +Parameter Sets: CreateViaJsonFilePath +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -JsonString +Json string supplied to the Create operation + +```yaml +Type: System.String +Parameter Sets: CreateViaJsonString +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Location +The geo-location where the resource lives + +```yaml +Type: System.String +Parameter Sets: CreateExpanded +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Name +The name of the StorageDiscoveryWorkspace + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: StorageDiscoveryWorkspaceName + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ResourceGroupName +The name of the resource group. +The name is case insensitive. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Scope +The scopes of the storage discovery workspace. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.StorageDiscovery.Models.IStorageDiscoveryScope[] +Parameter Sets: CreateExpanded +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Sku +The storage discovery sku + +```yaml +Type: System.String +Parameter Sets: CreateExpanded +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -SubscriptionId +The ID of the target subscription. +The value must be an UUID. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: (Get-AzContext).Subscription.Id +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Tag +Resource tags. + +```yaml +Type: System.Collections.Hashtable +Parameter Sets: CreateExpanded +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -WorkspaceRoot +The view level storage discovery data estate + +```yaml +Type: System.String[] +Parameter Sets: CreateExpanded +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Confirm +Prompts you for confirmation before running the cmdlet. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: cf + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -WhatIf +Shows what would happen if the cmdlet runs. +The cmdlet is not run. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: wi + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +## OUTPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.StorageDiscovery.Models.IStorageDiscoveryWorkspace + +## NOTES + +## RELATED LINKS + diff --git a/src/StorageDiscovery/StorageDiscovery.Autorest/docs/README.md b/src/StorageDiscovery/StorageDiscovery.Autorest/docs/README.md new file mode 100644 index 000000000000..30576f81dc28 --- /dev/null +++ b/src/StorageDiscovery/StorageDiscovery.Autorest/docs/README.md @@ -0,0 +1,11 @@ +# Docs +This directory contains the documentation of the cmdlets for the `Az.StorageDiscovery` module. To run documentation generation, use the `generate-help.ps1` script at the root module folder. Files in this folder will *always be overridden on regeneration*. To update documentation examples, please use the `..\examples` folder. + +## Info +- Modifiable: no +- Generated: all +- Committed: yes +- Packaged: yes + +## Details +The process of documentation generation loads `Az.StorageDiscovery` and analyzes the exported cmdlets from the module. It recognizes the [help comments](https://learn.microsoft.com/powershell/module/microsoft.powershell.core/about/about_comment_based_help) that are generated into the scripts in the `..\exports` folder. Additionally, when writing custom cmdlets in the `..\custom` folder, you can use the help comments syntax, which decorate the exported scripts at build-time. The documentation examples are taken from the `..\examples` folder. \ No newline at end of file diff --git a/src/StorageDiscovery/StorageDiscovery.Autorest/docs/Remove-AzStorageDiscoveryWorkspace.md b/src/StorageDiscovery/StorageDiscovery.Autorest/docs/Remove-AzStorageDiscoveryWorkspace.md new file mode 100644 index 000000000000..2f794e5251cf --- /dev/null +++ b/src/StorageDiscovery/StorageDiscovery.Autorest/docs/Remove-AzStorageDiscoveryWorkspace.md @@ -0,0 +1,179 @@ +--- +external help file: +Module Name: Az.StorageDiscovery +online version: https://learn.microsoft.com/powershell/module/az.storagediscovery/remove-azstoragediscoveryworkspace +schema: 2.0.0 +--- + +# Remove-AzStorageDiscoveryWorkspace + +## SYNOPSIS +Delete a StorageDiscoveryWorkspace + +## SYNTAX + +### Delete (Default) +``` +Remove-AzStorageDiscoveryWorkspace -Name -ResourceGroupName [-SubscriptionId ] + [-DefaultProfile ] [-PassThru] [-Confirm] [-WhatIf] [] +``` + +### DeleteViaIdentity +``` +Remove-AzStorageDiscoveryWorkspace -InputObject [-DefaultProfile ] + [-PassThru] [-Confirm] [-WhatIf] [] +``` + +## DESCRIPTION +Delete a StorageDiscoveryWorkspace + +## EXAMPLES + +### Example 1: Remove a workspace +```powershell +Remove-AzStorageDiscoveryWorkspace -Name $workSpaceName -ResourceGroupName $ResourceGroupName +``` + +This command deletes a workspace. + +## PARAMETERS + +### -DefaultProfile +The DefaultProfile parameter is not functional. +Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. + +```yaml +Type: System.Management.Automation.PSObject +Parameter Sets: (All) +Aliases: AzureRMContext, AzureCredential + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -InputObject +Identity Parameter + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.StorageDiscovery.Models.IStorageDiscoveryIdentity +Parameter Sets: DeleteViaIdentity +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: True (ByValue) +Accept wildcard characters: False +``` + +### -Name +The name of the StorageDiscoveryWorkspace + +```yaml +Type: System.String +Parameter Sets: Delete +Aliases: StorageDiscoveryWorkspaceName + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -PassThru +Returns true when the command succeeds + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ResourceGroupName +The name of the resource group. +The name is case insensitive. + +```yaml +Type: System.String +Parameter Sets: Delete +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -SubscriptionId +The ID of the target subscription. +The value must be an UUID. + +```yaml +Type: System.String +Parameter Sets: Delete +Aliases: + +Required: False +Position: Named +Default value: (Get-AzContext).Subscription.Id +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Confirm +Prompts you for confirmation before running the cmdlet. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: cf + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -WhatIf +Shows what would happen if the cmdlet runs. +The cmdlet is not run. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: wi + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.StorageDiscovery.Models.IStorageDiscoveryIdentity + +## OUTPUTS + +### System.Boolean + +## NOTES + +## RELATED LINKS + diff --git a/src/StorageDiscovery/StorageDiscovery.Autorest/docs/Update-AzStorageDiscoveryWorkspace.md b/src/StorageDiscovery/StorageDiscovery.Autorest/docs/Update-AzStorageDiscoveryWorkspace.md new file mode 100644 index 000000000000..4ef2dbe1a1f7 --- /dev/null +++ b/src/StorageDiscovery/StorageDiscovery.Autorest/docs/Update-AzStorageDiscoveryWorkspace.md @@ -0,0 +1,313 @@ +--- +external help file: +Module Name: Az.StorageDiscovery +online version: https://learn.microsoft.com/powershell/module/az.storagediscovery/update-azstoragediscoveryworkspace +schema: 2.0.0 +--- + +# Update-AzStorageDiscoveryWorkspace + +## SYNOPSIS +Update a StorageDiscoveryWorkspace + +## SYNTAX + +### UpdateExpanded (Default) +``` +Update-AzStorageDiscoveryWorkspace -Name -ResourceGroupName [-SubscriptionId ] + [-Description ] [-Scope ] [-Sku ] [-Tag ] + [-WorkspaceRoot ] [-DefaultProfile ] [-Confirm] [-WhatIf] [] +``` + +### UpdateViaIdentityExpanded +``` +Update-AzStorageDiscoveryWorkspace -InputObject [-Description ] + [-Scope ] [-Sku ] [-Tag ] [-WorkspaceRoot ] + [-DefaultProfile ] [-Confirm] [-WhatIf] [] +``` + +### UpdateViaJsonFilePath +``` +Update-AzStorageDiscoveryWorkspace -Name -ResourceGroupName -JsonFilePath + [-SubscriptionId ] [-DefaultProfile ] [-Confirm] [-WhatIf] [] +``` + +### UpdateViaJsonString +``` +Update-AzStorageDiscoveryWorkspace -Name -ResourceGroupName -JsonString + [-SubscriptionId ] [-DefaultProfile ] [-Confirm] [-WhatIf] [] +``` + +## DESCRIPTION +Update a StorageDiscoveryWorkspace + +## EXAMPLES + +### Example 1: Update a workspace +```powershell +$scope2 = New-AzStorageDiscoveryScopeObject -DisplayName "scope2" -ResourceType "Microsoft.Storage/storageAccounts" -TagKeysOnly "test2" -Tag @{"tag3" = "value3" } +Update-AzStorageDiscoveryWorkspace -Name $workSpaceName -ResourceGroupName $RGName -Description "test workSpace2" -Sku Free -Scope $scope2 -WorkspaceRoot $DiscoveryScopeLevel1,$DiscoveryScopeLevel2 -Tag @{"tag4" = "value4"} +``` + +```output +Description : test workSpace2 +Id : /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myresourcegroup/providers/Microsoft.StorageDiscovery/storageDiscoveryWorkspaces/myworkspace +Location : eastus2euap +Name : myworkspace +ProvisioningState : Succeeded +ResourceGroupName : myresourcegroup +Scope : {{ + "displayName": "scope2", + "resourceTypes": [ "Microsoft.Storage/storageAccounts" ], + "tagKeysOnly": [ "test2" ], + "tags": { + "tag3": "value3" + } + }} +Sku : Free +SystemDataCreatedAt : 7/24/2025 3:30:02 AM +SystemDataCreatedBy : user@microsoft.com +SystemDataCreatedByType : User +SystemDataLastModifiedAt : 7/24/2025 3:30:02 AM +SystemDataLastModifiedBy : user@microsoft.com +SystemDataLastModifiedByType : User +Tag : { + "tag4": "value4" + } +Type : microsoft.storagediscovery/storagediscoveryworkspaces +WorkspaceRoot : {/subscriptions/00000000-0000-0000-0000-000000000000,/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myresourcegroup} +``` + +The first command creates a discovery scope object, then the second command updates a workSpace properties. + +## PARAMETERS + +### -DefaultProfile +The DefaultProfile parameter is not functional. +Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. + +```yaml +Type: System.Management.Automation.PSObject +Parameter Sets: (All) +Aliases: AzureRMContext, AzureCredential + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Description +The description of the storage discovery workspace + +```yaml +Type: System.String +Parameter Sets: UpdateExpanded, UpdateViaIdentityExpanded +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -InputObject +Identity Parameter + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.StorageDiscovery.Models.IStorageDiscoveryIdentity +Parameter Sets: UpdateViaIdentityExpanded +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: True (ByValue) +Accept wildcard characters: False +``` + +### -JsonFilePath +Path of Json file supplied to the Update operation + +```yaml +Type: System.String +Parameter Sets: UpdateViaJsonFilePath +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -JsonString +Json string supplied to the Update operation + +```yaml +Type: System.String +Parameter Sets: UpdateViaJsonString +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Name +The name of the StorageDiscoveryWorkspace + +```yaml +Type: System.String +Parameter Sets: UpdateExpanded, UpdateViaJsonFilePath, UpdateViaJsonString +Aliases: StorageDiscoveryWorkspaceName + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ResourceGroupName +The name of the resource group. +The name is case insensitive. + +```yaml +Type: System.String +Parameter Sets: UpdateExpanded, UpdateViaJsonFilePath, UpdateViaJsonString +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Scope +The scopes of the storage discovery workspace. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.StorageDiscovery.Models.IStorageDiscoveryScope[] +Parameter Sets: UpdateExpanded, UpdateViaIdentityExpanded +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Sku +The storage discovery sku + +```yaml +Type: System.String +Parameter Sets: UpdateExpanded, UpdateViaIdentityExpanded +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -SubscriptionId +The ID of the target subscription. +The value must be an UUID. + +```yaml +Type: System.String +Parameter Sets: UpdateExpanded, UpdateViaJsonFilePath, UpdateViaJsonString +Aliases: + +Required: False +Position: Named +Default value: (Get-AzContext).Subscription.Id +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Tag +Resource tags. + +```yaml +Type: System.Collections.Hashtable +Parameter Sets: UpdateExpanded, UpdateViaIdentityExpanded +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -WorkspaceRoot +The view level storage discovery data estate + +```yaml +Type: System.String[] +Parameter Sets: UpdateExpanded, UpdateViaIdentityExpanded +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Confirm +Prompts you for confirmation before running the cmdlet. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: cf + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -WhatIf +Shows what would happen if the cmdlet runs. +The cmdlet is not run. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: wi + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.StorageDiscovery.Models.IStorageDiscoveryIdentity + +## OUTPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.StorageDiscovery.Models.IStorageDiscoveryWorkspace + +## NOTES + +## RELATED LINKS + diff --git a/src/StorageDiscovery/StorageDiscovery.Autorest/examples/Get-AzStorageDiscoveryWorkspace.md b/src/StorageDiscovery/StorageDiscovery.Autorest/examples/Get-AzStorageDiscoveryWorkspace.md new file mode 100644 index 000000000000..ddf0ae0fbd6b --- /dev/null +++ b/src/StorageDiscovery/StorageDiscovery.Autorest/examples/Get-AzStorageDiscoveryWorkspace.md @@ -0,0 +1,112 @@ +### Example 1: Get a workspace properties +```powershell +Get-AzStorageDiscoveryWorkspace -Name $workSpaceName -ResourceGroupName $ResourceGroupName +``` + +```output +Description : test workSpace +Id : /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myresourcegroup/providers/Microsoft.StorageDiscovery/storageDiscoveryWorkspaces/myworkspace +Location : eastus2euap +Name : myworkspace +ProvisioningState : Succeeded +ResourceGroupName : myresourcegroup +Scope : {{ + "displayName": "scope1", + "resourceTypes": [ "Microsoft.Storage/storageAccounts" ], + "tagKeysOnly": [ "key1" ], + "tags": { + "tag1": "value1", + "tag2": "value2" + } + }} +Sku : Standard +SystemDataCreatedAt : 7/24/2025 3:30:02 AM +SystemDataCreatedBy : user@microsoft.com +SystemDataCreatedByType : User +SystemDataLastModifiedAt : 7/24/2025 3:30:02 AM +SystemDataLastModifiedBy : user@microsoft.com +SystemDataLastModifiedByType : User +Tag : { + } +Type : microsoft.storagediscovery/storagediscoveryworkspaces +WorkspaceRoot : {/subscriptions/00000000-0000-0000-0000-000000000000} +``` + +The command gets a single workSpace properties with resource group name and workspace name. + +### Example 2: List workspace from subscription +```powershell + Get-AzStorageDiscoveryWorkspace +``` + +```output +Location Name SystemDataCreatedAt SystemDataCreatedBy SystemDataCreatedByType SystemDataLastModifiedAt SystemDataLastModifiedBy SystemDataLastModifiedByType ResourceGroupName +-------- ---- ------------------- ------------------- ----------------------- ------------------------ ------------------------ ---------------------------- ----------------- +eastus2 myworkspace 7/22/2025 10:37:51 AM user@microsoft.com User 7/22/2025 10:37:51 AM user@microsoft.com User myresourcegroup +eastus2 myworkspace2 7/24/2025 3:30:02 AM user@microsoft.com User 7/24/2025 3:42:49 AM user@microsoft.com User myresourcegroup2 +``` + +The command lists workSpaces from the current subscription. + +### Example 3: List workspace from resource group +```powershell + Get-AzStorageDiscoveryWorkspace -ResourceGroupName $ResourceGroupName |fl +``` + +```output +Description : test workSpace +Id : /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myresourcegroup/providers/Microsoft.StorageDiscovery/storageDiscoveryWorkspaces/myworkspace +Location : eastus2euap +Name : myworkspace +ProvisioningState : Succeeded +ResourceGroupName : myresourcegroup +Scope : {{ + "displayName": "scope1", + "resourceTypes": [ "Microsoft.Storage/storageAccounts" ], + "tagKeysOnly": [ "key1" ], + "tags": { + "tag1": "value1", + "tag2": "value2" + } + }} +Sku : Standard +SystemDataCreatedAt : 7/24/2025 3:30:02 AM +SystemDataCreatedBy : user@microsoft.com +SystemDataCreatedByType : User +SystemDataLastModifiedAt : 7/24/2025 3:30:02 AM +SystemDataLastModifiedBy : user@microsoft.com +SystemDataLastModifiedByType : User +Tag : { + } +Type : microsoft.storagediscovery/storagediscoveryworkspaces +WorkspaceRoot : {/subscriptions/00000000-0000-0000-0000-000000000000} + +Description : test workSpace2 +Id : /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myresourcegroup/providers/Microsoft.StorageDiscovery/storageDiscoveryWorkspaces/myworkspace2 +Location : eastus2euap +Name : myworkspace2 +ProvisioningState : Succeeded +ResourceGroupName : myresourcegroup +Scope : {{ + "displayName": "scope2", + "resourceTypes": [ "Microsoft.Storage/storageAccounts" ], + "tagKeysOnly": [ "key2" ], + "tags": { + "tag1": "value1" + } + }} +Sku : Standard +SystemDataCreatedAt : 7/24/2025 3:31:04 AM +SystemDataCreatedBy : user@microsoft.com +SystemDataCreatedByType : User +SystemDataLastModifiedAt : 7/24/2025 3:31:04 AM +SystemDataLastModifiedBy : user@microsoft.com +SystemDataLastModifiedByType : User +Tag : { + } +Type : microsoft.storagediscovery/storagediscoveryworkspaces +WorkspaceRoot : {/subscriptions/00000000-0000-0000-0000-000000000000,/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myresourcegroup} +``` + +The command lists workSpaces from a resource group, and format the output as list. + diff --git a/src/StorageDiscovery/StorageDiscovery.Autorest/examples/New-AzStorageDiscoveryScopeObject.md b/src/StorageDiscovery/StorageDiscovery.Autorest/examples/New-AzStorageDiscoveryScopeObject.md new file mode 100644 index 000000000000..f2f4bdde1a03 --- /dev/null +++ b/src/StorageDiscovery/StorageDiscovery.Autorest/examples/New-AzStorageDiscoveryScopeObject.md @@ -0,0 +1,37 @@ +### Example 1: Create a workspace with discovery scope object +```powershell +$scope1 = New-AzStorageDiscoveryScopeObject -DisplayName "scope1" -ResourceType "Microsoft.Storage/storageAccounts" -TagKeysOnly "key1" -Tag @{"tag1" = "value1"; "tag2" = "value2" } +New-AzStorageDiscoveryWorkspace -Name $workSpaceName -ResourceGroupName $ResourceGroupName -Location $location -WorkspaceRoot $DiscoveryScopeLevel -Sku Standard -Scope $scope1 -Description "test workSpace" +``` + +```output +Description : test workSpace +Id : /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myresourcegroup/providers/Microsoft.StorageDiscovery/storageDiscoveryWorkspaces/myworkspace +Location : eastus2euap +Name : myworkspace +ProvisioningState : Succeeded +ResourceGroupName : myresourcegroup +Scope : {{ + "displayName": "scope1", + "resourceTypes": [ "Microsoft.Storage/storageAccounts" ], + "tagKeysOnly": [ "key1" ], + "tags": { + "tag1": "value1", + "tag2": "value2" + } + }} +Sku : Standard +SystemDataCreatedAt : 7/24/2025 3:30:02 AM +SystemDataCreatedBy : user@microsoft.com +SystemDataCreatedByType : User +SystemDataLastModifiedAt : 7/24/2025 3:30:02 AM +SystemDataLastModifiedBy : user@microsoft.com +SystemDataLastModifiedByType : User +Tag : { + } +Type : microsoft.storagediscovery/storagediscoveryworkspaces +WorkspaceRoot : {/subscriptions/00000000-0000-0000-0000-000000000000} +``` + +The first command creates a discovery scope object, then the second command creates a workspace with the discovery scope object. + diff --git a/src/StorageDiscovery/StorageDiscovery.Autorest/examples/New-AzStorageDiscoveryWorkspace.md b/src/StorageDiscovery/StorageDiscovery.Autorest/examples/New-AzStorageDiscoveryWorkspace.md new file mode 100644 index 000000000000..5a210ea38516 --- /dev/null +++ b/src/StorageDiscovery/StorageDiscovery.Autorest/examples/New-AzStorageDiscoveryWorkspace.md @@ -0,0 +1,36 @@ +### Example 1: Create a workspace +```powershell +$scope1 = New-AzStorageDiscoveryScopeObject -DisplayName "scope1" -ResourceType "Microsoft.Storage/storageAccounts" -TagKeysOnly "key1" -Tag @{"tag1" = "value1"; "tag2" = "value2" } +New-AzStorageDiscoveryWorkspace -Name $workSpaceName -ResourceGroupName $ResourceGroupName -Location $location -WorkspaceRoot $DiscoveryScopeLevel -Sku Standard -Scope $scope1 -Description "test workSpace" +``` + +```output +Description : test workSpace +Id : /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myresourcegroup/providers/Microsoft.StorageDiscovery/storageDiscoveryWorkspaces/myworkspace +Location : eastus2euap +Name : myworkspace +ProvisioningState : Succeeded +ResourceGroupName : myresourcegroup +Scope : {{ + "displayName": "scope1", + "resourceTypes": [ "Microsoft.Storage/storageAccounts" ], + "tagKeysOnly": [ "key1" ], + "tags": { + "tag1": "value1", + "tag2": "value2" + } + }} +Sku : Standard +SystemDataCreatedAt : 7/24/2025 3:30:02 AM +SystemDataCreatedBy : user@microsoft.com +SystemDataCreatedByType : User +SystemDataLastModifiedAt : 7/24/2025 3:30:02 AM +SystemDataLastModifiedBy : user@microsoft.com +SystemDataLastModifiedByType : User +Tag : { + } +Type : microsoft.storagediscovery/storagediscoveryworkspaces +WorkspaceRoot : {/subscriptions/00000000-0000-0000-0000-000000000000} +``` + +The first command creates a discovery scope object, then the second command creates a workspace with the discovery scope object. diff --git a/src/StorageDiscovery/StorageDiscovery.Autorest/examples/Remove-AzStorageDiscoveryWorkspace.md b/src/StorageDiscovery/StorageDiscovery.Autorest/examples/Remove-AzStorageDiscoveryWorkspace.md new file mode 100644 index 000000000000..55c84967ed76 --- /dev/null +++ b/src/StorageDiscovery/StorageDiscovery.Autorest/examples/Remove-AzStorageDiscoveryWorkspace.md @@ -0,0 +1,7 @@ +### Example 1: Remove a workspace +```powershell +Remove-AzStorageDiscoveryWorkspace -Name $workSpaceName -ResourceGroupName $ResourceGroupName +``` + +This command deletes a workspace. + diff --git a/src/StorageDiscovery/StorageDiscovery.Autorest/examples/Update-AzStorageDiscoveryWorkspace.md b/src/StorageDiscovery/StorageDiscovery.Autorest/examples/Update-AzStorageDiscoveryWorkspace.md new file mode 100644 index 000000000000..9312379c6d4d --- /dev/null +++ b/src/StorageDiscovery/StorageDiscovery.Autorest/examples/Update-AzStorageDiscoveryWorkspace.md @@ -0,0 +1,37 @@ +### Example 1: Update a workspace +```powershell +$scope2 = New-AzStorageDiscoveryScopeObject -DisplayName "scope2" -ResourceType "Microsoft.Storage/storageAccounts" -TagKeysOnly "test2" -Tag @{"tag3" = "value3" } +Update-AzStorageDiscoveryWorkspace -Name $workSpaceName -ResourceGroupName $RGName -Description "test workSpace2" -Sku Free -Scope $scope2 -WorkspaceRoot $DiscoveryScopeLevel1,$DiscoveryScopeLevel2 -Tag @{"tag4" = "value4"} +``` + +```output +Description : test workSpace2 +Id : /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myresourcegroup/providers/Microsoft.StorageDiscovery/storageDiscoveryWorkspaces/myworkspace +Location : eastus2euap +Name : myworkspace +ProvisioningState : Succeeded +ResourceGroupName : myresourcegroup +Scope : {{ + "displayName": "scope2", + "resourceTypes": [ "Microsoft.Storage/storageAccounts" ], + "tagKeysOnly": [ "test2" ], + "tags": { + "tag3": "value3" + } + }} +Sku : Free +SystemDataCreatedAt : 7/24/2025 3:30:02 AM +SystemDataCreatedBy : user@microsoft.com +SystemDataCreatedByType : User +SystemDataLastModifiedAt : 7/24/2025 3:30:02 AM +SystemDataLastModifiedBy : user@microsoft.com +SystemDataLastModifiedByType : User +Tag : { + "tag4": "value4" + } +Type : microsoft.storagediscovery/storagediscoveryworkspaces +WorkspaceRoot : {/subscriptions/00000000-0000-0000-0000-000000000000,/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myresourcegroup} +``` + +The first command creates a discovery scope object, then the second command updates a workSpace properties. + diff --git a/src/StorageDiscovery/StorageDiscovery.Autorest/generate-info.json b/src/StorageDiscovery/StorageDiscovery.Autorest/generate-info.json new file mode 100644 index 000000000000..a4cd5e8db8cf --- /dev/null +++ b/src/StorageDiscovery/StorageDiscovery.Autorest/generate-info.json @@ -0,0 +1,3 @@ +{ + "generate_Id": "60c9a46f-76b7-4bd5-8af2-72f8ed0c8de7" +} diff --git a/src/StorageDiscovery/StorageDiscovery.Autorest/how-to.md b/src/StorageDiscovery/StorageDiscovery.Autorest/how-to.md new file mode 100644 index 000000000000..ffffbb11876d --- /dev/null +++ b/src/StorageDiscovery/StorageDiscovery.Autorest/how-to.md @@ -0,0 +1,58 @@ +# How-To +This document describes how to develop for `Az.StorageDiscovery`. + +## Building `Az.StorageDiscovery` +To build, run the `build-module.ps1` at the root of the module directory. This will generate the proxy script cmdlets that are the cmdlets being exported by this module. After the build completes, the proxy script cmdlets will be output to the `exports` folder. To read more about the proxy script cmdlets, look at the [README.md](exports/README.md) in the `exports` folder. + +## Creating custom cmdlets +To add cmdlets that were not generated by the REST specification, use the `custom` folder. This folder allows you to add handwritten `.ps1` and `.cs` files. Currently, we support using `.ps1` scripts as new cmdlets or as additional low-level variants (via `ParameterSet`), and `.cs` files as low-level (variants) cmdlets that the exported script cmdlets call. We do not support exporting any `.cs` (dll) cmdlets directly. To read more about custom cmdlets, look at the [README.md](custom/README.md) in the `custom` folder. + +## Generating documentation +To generate documentation, the process is now integrated into the `build-module.ps1` script. If you don't want to run this process as part of `build-module.ps1`, you can provide the `-NoDocs` switch. If you want to run documentation generation after the build process, you may still run the `generate-help.ps1` script. Overall, the process will look at the documentation comments in the generated and custom cmdlets and types, and create `.md` files into the `docs` folder. Additionally, this pulls in any examples from the `examples` folder and adds them to the generated help markdown documents. To read more about examples, look at the [README.md](examples/README.md) in the `examples` folder. To read more about documentation, look at the [README.md](docs/README.md) in the `docs` folder. + +## Testing `Az.StorageDiscovery` +To test the cmdlets, we use [Pester](https://github.com/pester/Pester). Tests scripts (`.ps1`) should be added to the `test` folder. To execute the Pester tests, run the `test-module.ps1` script. This will run all tests in `playback` mode within the `test` folder. To read more about testing cmdlets, look at the [README.md](examples/README.md) in the `examples` folder. + +## Packing `Az.StorageDiscovery` +To pack `Az.StorageDiscovery` for distribution, run the `pack-module.ps1` script. This will take the contents of multiple directories and certain root-folder files to create a `.nupkg`. The structure of the `.nupkg` is created so it can be loaded part of a [PSRepository](https://learn.microsoft.com/powershell/module/powershellget/register-psrepository). Additionally, this package is in a format for distribution to the [PSGallery](https://www.powershellgallery.com/). For signing an Azure module, please contact the [Azure PowerShell](https://github.com/Azure/azure-powershell) team. + +## Module Script Details +There are multiple scripts created for performing different actions for developing `Az.StorageDiscovery`. +- `build-module.ps1` + - Builds the module DLL (`./bin/Az.StorageDiscovery.private.dll`), creates the exported cmdlets and documentation, generates custom cmdlet test stubs and exported cmdlet example stubs, and updates `./Az.StorageDiscovery.psd1` with Azure profile information. + - **Parameters**: [`Switch` parameters] + - `-Run`: After building, creates an isolated PowerShell session and loads `Az.StorageDiscovery`. + - `-Test`: After building, runs the `Pester` tests defined in the `test` folder. + - `-Docs`: After building, generates the Markdown documents for the modules into the `docs` folder. + - `-Pack`: After building, packages the module into a `.nupkg`. + - `-Code`: After building, opens a VSCode window with the module's directory and runs (see `-Run`) the module. + - `-Release`: Builds the module in `Release` configuration (as opposed to `Debug` configuration). + - `-NoDocs`: Supresses writing the documentation markdown files as part of the cmdlet exporting process. + - `-Debugger`: Used when attaching the debugger in Visual Studio to the PowerShell session, and running the build process without recompiling the DLL. This suppresses running the script as an isolated process. +- `run-module.ps1` + - Creates an isolated PowerShell session and loads `Az.StorageDiscovery` into the session. + - Same as `-Run` in `build-module.ps1`. + - **Parameters**: [`Switch` parameters] + - `-Code`: Opens a VSCode window with the module's directory. + - Same as `-Code` in `build-module.ps1`. +- `generate-help.ps1` + - Generates the Markdown documents for the modules into the `docs` folder. + - Same as `-Docs` in `build-module.ps1`. +- `test-module.ps1` + - Runs the `Pester` tests defined in the `test` folder. + - Same as `-Test` in `build-module.ps1`. +- `pack-module.ps1` + - Packages the module into a `.nupkg` for distribution. + - Same as `-Pack` in `build-module.ps1`. +- `generate-help.ps1` + - Generates the Markdown documents for the modules into the `docs` folder. + - Same as `-Docs` in `build-module.ps1`. + - This process is now integrated into `build-module.ps1` automatically. To disable, use `-NoDocs` when running `build-module.ps1`. +- `export-surface.ps1` + - Generates Markdown documents for both the cmdlet surface and the model (class) surface of the module. + - These files are placed into the `resources` folder. + - Used for investigating the surface of your module. These are *not* documentation for distribution. +- `check-dependencies.ps1` + - Used in `run-module.ps1` and `test-module.ps1` to verify dependent modules are available to run those tasks. + - It will download local (within the module's directory structure) versions of those modules as needed. + - This script *does not* need to be ran by-hand. \ No newline at end of file diff --git a/src/StorageDiscovery/StorageDiscovery.Autorest/resources/README.md b/src/StorageDiscovery/StorageDiscovery.Autorest/resources/README.md new file mode 100644 index 000000000000..937f07f8fec2 --- /dev/null +++ b/src/StorageDiscovery/StorageDiscovery.Autorest/resources/README.md @@ -0,0 +1,11 @@ +# Resources +This directory can contain any additional resources for module that are not required at runtime. This directory **does not** get packaged with the module. If you have assets for custom implementation, place them into the `..\custom` folder. + +## Info +- Modifiable: yes +- Generated: no +- Committed: yes +- Packaged: no + +## Purpose +Use this folder to put anything you want to keep around as part of the repository for the module, but is not something that is required for the module. For example, development files, packaged builds, or additional information. This is only intended to be used in repositories where the module's output directory is cleaned, but tangential resources for the module want to remain intact. \ No newline at end of file diff --git a/src/StorageDiscovery/StorageDiscovery.Autorest/test/Get-AzStorageDiscoveryWorkspace.Tests.ps1 b/src/StorageDiscovery/StorageDiscovery.Autorest/test/Get-AzStorageDiscoveryWorkspace.Tests.ps1 new file mode 100644 index 000000000000..b3cd685bc801 --- /dev/null +++ b/src/StorageDiscovery/StorageDiscovery.Autorest/test/Get-AzStorageDiscoveryWorkspace.Tests.ps1 @@ -0,0 +1,33 @@ +if(($null -eq $TestName) -or ($TestName -contains 'Get-AzStorageDiscoveryWorkspace')) +{ + $loadEnvPath = Join-Path $PSScriptRoot 'loadEnv.ps1' + if (-Not (Test-Path -Path $loadEnvPath)) { + $loadEnvPath = Join-Path $PSScriptRoot '..\loadEnv.ps1' + } + . ($loadEnvPath) + $TestRecordingFile = Join-Path $PSScriptRoot 'Get-AzStorageDiscoveryWorkspace.Recording.json' + $currentPath = $PSScriptRoot + while(-not $mockingPath) { + $mockingPath = Get-ChildItem -Path $currentPath -Recurse -Include 'HttpPipelineMocking.ps1' -File + $currentPath = Split-Path -Path $currentPath -Parent + } + . ($mockingPath | Select-Object -First 1).FullName +} + +Describe 'Get-AzStorageDiscoveryWorkspace' { + It 'List1' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } + + It 'Get' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } + + It 'List' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } + + It 'GetViaIdentity' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } +} diff --git a/src/StorageDiscovery/StorageDiscovery.Autorest/test/New-AzStorageDiscoveryScopeObject.Tests.ps1 b/src/StorageDiscovery/StorageDiscovery.Autorest/test/New-AzStorageDiscoveryScopeObject.Tests.ps1 new file mode 100644 index 000000000000..7becd0ed77ab --- /dev/null +++ b/src/StorageDiscovery/StorageDiscovery.Autorest/test/New-AzStorageDiscoveryScopeObject.Tests.ps1 @@ -0,0 +1,21 @@ +if(($null -eq $TestName) -or ($TestName -contains 'New-AzStorageDiscoveryScopeObject')) +{ + $loadEnvPath = Join-Path $PSScriptRoot 'loadEnv.ps1' + if (-Not (Test-Path -Path $loadEnvPath)) { + $loadEnvPath = Join-Path $PSScriptRoot '..\loadEnv.ps1' + } + . ($loadEnvPath) + $TestRecordingFile = Join-Path $PSScriptRoot 'New-AzStorageDiscoveryScopeObject.Recording.json' + $currentPath = $PSScriptRoot + while(-not $mockingPath) { + $mockingPath = Get-ChildItem -Path $currentPath -Recurse -Include 'HttpPipelineMocking.ps1' -File + $currentPath = Split-Path -Path $currentPath -Parent + } + . ($mockingPath | Select-Object -First 1).FullName +} + +Describe 'New-AzStorageDiscoveryScopeObject' { + It '__AllParameterSets' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } +} diff --git a/src/StorageDiscovery/StorageDiscovery.Autorest/test/New-AzStorageDiscoveryWorkspace.Tests.ps1 b/src/StorageDiscovery/StorageDiscovery.Autorest/test/New-AzStorageDiscoveryWorkspace.Tests.ps1 new file mode 100644 index 000000000000..2666a74122a6 --- /dev/null +++ b/src/StorageDiscovery/StorageDiscovery.Autorest/test/New-AzStorageDiscoveryWorkspace.Tests.ps1 @@ -0,0 +1,29 @@ +if(($null -eq $TestName) -or ($TestName -contains 'New-AzStorageDiscoveryWorkspace')) +{ + $loadEnvPath = Join-Path $PSScriptRoot 'loadEnv.ps1' + if (-Not (Test-Path -Path $loadEnvPath)) { + $loadEnvPath = Join-Path $PSScriptRoot '..\loadEnv.ps1' + } + . ($loadEnvPath) + $TestRecordingFile = Join-Path $PSScriptRoot 'New-AzStorageDiscoveryWorkspace.Recording.json' + $currentPath = $PSScriptRoot + while(-not $mockingPath) { + $mockingPath = Get-ChildItem -Path $currentPath -Recurse -Include 'HttpPipelineMocking.ps1' -File + $currentPath = Split-Path -Path $currentPath -Parent + } + . ($mockingPath | Select-Object -First 1).FullName +} + +Describe 'New-AzStorageDiscoveryWorkspace' { + It 'CreateExpanded' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } + + It 'CreateViaJsonFilePath' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } + + It 'CreateViaJsonString' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } +} diff --git a/src/StorageDiscovery/StorageDiscovery.Autorest/test/README.md b/src/StorageDiscovery/StorageDiscovery.Autorest/test/README.md new file mode 100644 index 000000000000..7c752b4c8c43 --- /dev/null +++ b/src/StorageDiscovery/StorageDiscovery.Autorest/test/README.md @@ -0,0 +1,17 @@ +# Test +This directory contains the [Pester](https://www.powershellgallery.com/packages/Pester) tests to run for the module. We use Pester as it is the unofficial standard for PowerShell unit testing. Test stubs for custom cmdlets (created in `..\custom`) will be generated into this folder when `build-module.ps1` is ran. These test stubs will fail automatically, to indicate that tests should be written for custom cmdlets. + +## Info +- Modifiable: yes +- Generated: partial +- Committed: yes +- Packaged: no + +## Details +We allow three testing modes: *live*, *record*, and *playback*. These can be selected using the `-Live`, `-Record`, and `-Playback` switches respectively on the `test-module.ps1` script. This script will run through any `.Tests.ps1` scripts in the `test` folder. If you choose the *record* mode, it will create a `.Recording.json` file of the REST calls between the client and server. Then, when you choose *playback* mode, it will use the `.Recording.json` file to mock the communication between server and client. The *live* mode runs the same as the *record* mode; however, it doesn't create the `.Recording.json` file. + +## Purpose +Custom cmdlets generally encompass additional functionality not described in the REST specification, or combines functionality generated from the REST spec. To validate this functionality continues to operate as intended, creating tests that can be ran and re-ran against custom cmdlets is part of the framework. + +## Usage +To execute tests, run the `test-module.ps1`. To write tests, [this example](https://github.com/pester/Pester/blob/8b9cf4248315e44f1ac6673be149f7e0d7f10466/Examples/Planets/Get-Planet.Tests.ps1#L1) from the Pester repository is very useful for getting started. \ No newline at end of file diff --git a/src/StorageDiscovery/StorageDiscovery.Autorest/test/Remove-AzStorageDiscoveryWorkspace.Tests.ps1 b/src/StorageDiscovery/StorageDiscovery.Autorest/test/Remove-AzStorageDiscoveryWorkspace.Tests.ps1 new file mode 100644 index 000000000000..c61262a1652a --- /dev/null +++ b/src/StorageDiscovery/StorageDiscovery.Autorest/test/Remove-AzStorageDiscoveryWorkspace.Tests.ps1 @@ -0,0 +1,25 @@ +if(($null -eq $TestName) -or ($TestName -contains 'Remove-AzStorageDiscoveryWorkspace')) +{ + $loadEnvPath = Join-Path $PSScriptRoot 'loadEnv.ps1' + if (-Not (Test-Path -Path $loadEnvPath)) { + $loadEnvPath = Join-Path $PSScriptRoot '..\loadEnv.ps1' + } + . ($loadEnvPath) + $TestRecordingFile = Join-Path $PSScriptRoot 'Remove-AzStorageDiscoveryWorkspace.Recording.json' + $currentPath = $PSScriptRoot + while(-not $mockingPath) { + $mockingPath = Get-ChildItem -Path $currentPath -Recurse -Include 'HttpPipelineMocking.ps1' -File + $currentPath = Split-Path -Path $currentPath -Parent + } + . ($mockingPath | Select-Object -First 1).FullName +} + +Describe 'Remove-AzStorageDiscoveryWorkspace' { + It 'Delete' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } + + It 'DeleteViaIdentity' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } +} diff --git a/src/StorageDiscovery/StorageDiscovery.Autorest/test/Update-AzStorageDiscoveryWorkspace.Tests.ps1 b/src/StorageDiscovery/StorageDiscovery.Autorest/test/Update-AzStorageDiscoveryWorkspace.Tests.ps1 new file mode 100644 index 000000000000..9e2113d39b67 --- /dev/null +++ b/src/StorageDiscovery/StorageDiscovery.Autorest/test/Update-AzStorageDiscoveryWorkspace.Tests.ps1 @@ -0,0 +1,33 @@ +if(($null -eq $TestName) -or ($TestName -contains 'Update-AzStorageDiscoveryWorkspace')) +{ + $loadEnvPath = Join-Path $PSScriptRoot 'loadEnv.ps1' + if (-Not (Test-Path -Path $loadEnvPath)) { + $loadEnvPath = Join-Path $PSScriptRoot '..\loadEnv.ps1' + } + . ($loadEnvPath) + $TestRecordingFile = Join-Path $PSScriptRoot 'Update-AzStorageDiscoveryWorkspace.Recording.json' + $currentPath = $PSScriptRoot + while(-not $mockingPath) { + $mockingPath = Get-ChildItem -Path $currentPath -Recurse -Include 'HttpPipelineMocking.ps1' -File + $currentPath = Split-Path -Path $currentPath -Parent + } + . ($mockingPath | Select-Object -First 1).FullName +} + +Describe 'Update-AzStorageDiscoveryWorkspace' { + It 'UpdateExpanded' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } + + It 'UpdateViaJsonString' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } + + It 'UpdateViaJsonFilePath' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } + + It 'UpdateViaIdentityExpanded' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } +} diff --git a/src/StorageDiscovery/StorageDiscovery.Autorest/test/loadEnv.ps1 b/src/StorageDiscovery/StorageDiscovery.Autorest/test/loadEnv.ps1 new file mode 100644 index 000000000000..6a7c385c6b7d --- /dev/null +++ b/src/StorageDiscovery/StorageDiscovery.Autorest/test/loadEnv.ps1 @@ -0,0 +1,29 @@ +# ---------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# http://www.apache.org/licenses/LICENSE-2.0 +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# Code generated by Microsoft (R) AutoRest Code Generator.Changes may cause incorrect behavior and will be lost if the code +# is regenerated. +# ---------------------------------------------------------------------------------- +$envFile = 'env.json' +if ($TestMode -eq 'live') { + $envFile = 'localEnv.json' +} + +if (Test-Path -Path (Join-Path $PSScriptRoot $envFile)) { + $envFilePath = Join-Path $PSScriptRoot $envFile +} else { + $envFilePath = Join-Path $PSScriptRoot '..\$envFile' +} +$env = @{} +if (Test-Path -Path $envFilePath) { + $env = Get-Content (Join-Path $PSScriptRoot $envFile) | ConvertFrom-Json + $PSDefaultParameterValues=@{"*:Tenant"=$env.Tenant} +} \ No newline at end of file diff --git a/src/StorageDiscovery/StorageDiscovery.Autorest/test/utils.ps1 b/src/StorageDiscovery/StorageDiscovery.Autorest/test/utils.ps1 new file mode 100644 index 000000000000..f8497fbd7da0 --- /dev/null +++ b/src/StorageDiscovery/StorageDiscovery.Autorest/test/utils.ps1 @@ -0,0 +1,56 @@ +function RandomString([bool]$allChars, [int32]$len) { + if ($allChars) { + return -join ((33..126) | Get-Random -Count $len | % {[char]$_}) + } else { + return -join ((48..57) + (97..122) | Get-Random -Count $len | % {[char]$_}) + } +} +function Start-TestSleep { + [CmdletBinding(DefaultParameterSetName = 'SleepBySeconds')] + param( + [parameter(Mandatory = $true, Position = 0, ParameterSetName = 'SleepBySeconds')] + [ValidateRange(0.0, 2147483.0)] + [double] $Seconds, + + [parameter(Mandatory = $true, ParameterSetName = 'SleepByMilliseconds')] + [ValidateRange('NonNegative')] + [Alias('ms')] + [int] $Milliseconds + ) + + if ($TestMode -ne 'playback') { + switch ($PSCmdlet.ParameterSetName) { + 'SleepBySeconds' { + Start-Sleep -Seconds $Seconds + } + 'SleepByMilliseconds' { + Start-Sleep -Milliseconds $Milliseconds + } + } + } +} + +$env = @{} +if ($UsePreviousConfigForRecord) { + $previousEnv = Get-Content (Join-Path $PSScriptRoot 'env.json') | ConvertFrom-Json + $previousEnv.psobject.properties | Foreach-Object { $env[$_.Name] = $_.Value } +} +# Add script method called AddWithCache to $env, when useCache is set true, it will try to get the value from the $env first. +# example: $val = $env.AddWithCache('key', $val, $true) +$env | Add-Member -Type ScriptMethod -Value { param( [string]$key, [object]$val, [bool]$useCache) if ($this.Contains($key) -and $useCache) { return $this[$key] } else { $this[$key] = $val; return $val } } -Name 'AddWithCache' +function setupEnv() { + # Preload subscriptionId and tenant from context, which will be used in test + # as default. You could change them if needed. + $env.SubscriptionId = (Get-AzContext).Subscription.Id + $env.Tenant = (Get-AzContext).Tenant.Id + # For any resources you created for test, you should add it to $env here. + $envFile = 'env.json' + if ($TestMode -eq 'live') { + $envFile = 'localEnv.json' + } + set-content -Path (Join-Path $PSScriptRoot $envFile) -Value (ConvertTo-Json $env) +} +function cleanupEnv() { + # Clean resources you create for testing +} + diff --git a/src/StorageDiscovery/StorageDiscovery.Autorest/tsp-location.yaml b/src/StorageDiscovery/StorageDiscovery.Autorest/tsp-location.yaml new file mode 100644 index 000000000000..be33a3b67cd8 --- /dev/null +++ b/src/StorageDiscovery/StorageDiscovery.Autorest/tsp-location.yaml @@ -0,0 +1,4 @@ +directory: specification/storagediscovery/Microsoft.StorageDiscovery.Management +commit: 5b89f55349a8125c3fc168f7c4b7d3369dfe1c8e +repo: Azure/azure-rest-api-specs +additionalDirectories: diff --git a/src/StorageDiscovery/StorageDiscovery.Autorest/utils/Get-SubscriptionIdTestSafe.ps1 b/src/StorageDiscovery/StorageDiscovery.Autorest/utils/Get-SubscriptionIdTestSafe.ps1 new file mode 100644 index 000000000000..5319862d3372 --- /dev/null +++ b/src/StorageDiscovery/StorageDiscovery.Autorest/utils/Get-SubscriptionIdTestSafe.ps1 @@ -0,0 +1,7 @@ +param() +if ($env:AzPSAutorestTestPlaybackMode) { + $loadEnvPath = Join-Path $PSScriptRoot '..' 'test' 'loadEnv.ps1' + . ($loadEnvPath) + return $env.SubscriptionId +} +return (Get-AzContext).Subscription.Id \ No newline at end of file diff --git a/src/StorageDiscovery/StorageDiscovery.Autorest/utils/Unprotect-SecureString.ps1 b/src/StorageDiscovery/StorageDiscovery.Autorest/utils/Unprotect-SecureString.ps1 new file mode 100644 index 000000000000..cb05b51a6220 --- /dev/null +++ b/src/StorageDiscovery/StorageDiscovery.Autorest/utils/Unprotect-SecureString.ps1 @@ -0,0 +1,16 @@ +#This script converts securestring to plaintext + +param( + [Parameter(Mandatory, ValueFromPipeline)] + [System.Security.SecureString] + ${SecureString} +) + +$ssPtr = [System.Runtime.InteropServices.Marshal]::SecureStringToBSTR($SecureString) +try { + $plaintext = [System.Runtime.InteropServices.Marshal]::PtrToStringBSTR($ssPtr) +} finally { + [System.Runtime.InteropServices.Marshal]::ZeroFreeBSTR($ssPtr) +} + +return $plaintext \ No newline at end of file diff --git a/src/StorageDiscovery/StorageDiscovery.sln b/src/StorageDiscovery/StorageDiscovery.sln new file mode 100644 index 000000000000..bdbe3a964749 --- /dev/null +++ b/src/StorageDiscovery/StorageDiscovery.sln @@ -0,0 +1,145 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio Version 17 +VisualStudioVersion = 17.0.31903.59 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Accounts", "Accounts", "{32836310-FB5E-5A92-56B4-44D826EF11F5}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Accounts", "..\Accounts\Accounts\Accounts.csproj", "{2EB698F8-E3A5-4838-B33F-89E71D635D9A}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AssemblyLoading", "..\Accounts\AssemblyLoading\AssemblyLoading.csproj", "{EE12B9E6-F116-410E-BD21-1BAA6AA5BB9D}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Authentication", "..\Accounts\Authentication\Authentication.csproj", "{CC74BDCF-6E62-4663-B4B6-E80A3E8DD79F}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Authentication.ResourceManager", "..\Accounts\Authentication.ResourceManager\Authentication.ResourceManager.csproj", "{F93560A3-FC63-4E06-A715-597F0A478740}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AuthenticationAssemblyLoadContext", "..\Accounts\AuthenticationAssemblyLoadContext\AuthenticationAssemblyLoadContext.csproj", "{2F9DA2FC-0924-49B4-A517-C67A143D7913}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Authenticators", "..\Accounts\Authenticators\Authenticators.csproj", "{74E15915-CE18-42BE-B242-150C35CB4F96}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "StorageDiscovery", "StorageDiscovery\StorageDiscovery.csproj", "{E9E742E3-F685-4352-98F0-2E7371AE69B1}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "StorageDiscovery.Autorest", "StorageDiscovery.Autorest", "{A3A293A0-CC6B-7EBD-D75E-757575894D50}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Az.StorageDiscovery", "..\..\generated\StorageDiscovery\StorageDiscovery.Autorest\Az.StorageDiscovery.csproj", "{70595303-31C3-4C27-B382-4DA985505546}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Debug|x64 = Debug|x64 + Debug|x86 = Debug|x86 + Release|Any CPU = Release|Any CPU + Release|x64 = Release|x64 + Release|x86 = Release|x86 + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {2EB698F8-E3A5-4838-B33F-89E71D635D9A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {2EB698F8-E3A5-4838-B33F-89E71D635D9A}.Debug|Any CPU.Build.0 = Debug|Any CPU + {2EB698F8-E3A5-4838-B33F-89E71D635D9A}.Debug|x64.ActiveCfg = Debug|Any CPU + {2EB698F8-E3A5-4838-B33F-89E71D635D9A}.Debug|x64.Build.0 = Debug|Any CPU + {2EB698F8-E3A5-4838-B33F-89E71D635D9A}.Debug|x86.ActiveCfg = Debug|Any CPU + {2EB698F8-E3A5-4838-B33F-89E71D635D9A}.Debug|x86.Build.0 = Debug|Any CPU + {2EB698F8-E3A5-4838-B33F-89E71D635D9A}.Release|Any CPU.ActiveCfg = Release|Any CPU + {2EB698F8-E3A5-4838-B33F-89E71D635D9A}.Release|Any CPU.Build.0 = Release|Any CPU + {2EB698F8-E3A5-4838-B33F-89E71D635D9A}.Release|x64.ActiveCfg = Release|Any CPU + {2EB698F8-E3A5-4838-B33F-89E71D635D9A}.Release|x64.Build.0 = Release|Any CPU + {2EB698F8-E3A5-4838-B33F-89E71D635D9A}.Release|x86.ActiveCfg = Release|Any CPU + {2EB698F8-E3A5-4838-B33F-89E71D635D9A}.Release|x86.Build.0 = Release|Any CPU + {EE12B9E6-F116-410E-BD21-1BAA6AA5BB9D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {EE12B9E6-F116-410E-BD21-1BAA6AA5BB9D}.Debug|Any CPU.Build.0 = Debug|Any CPU + {EE12B9E6-F116-410E-BD21-1BAA6AA5BB9D}.Debug|x64.ActiveCfg = Debug|Any CPU + {EE12B9E6-F116-410E-BD21-1BAA6AA5BB9D}.Debug|x64.Build.0 = Debug|Any CPU + {EE12B9E6-F116-410E-BD21-1BAA6AA5BB9D}.Debug|x86.ActiveCfg = Debug|Any CPU + {EE12B9E6-F116-410E-BD21-1BAA6AA5BB9D}.Debug|x86.Build.0 = Debug|Any CPU + {EE12B9E6-F116-410E-BD21-1BAA6AA5BB9D}.Release|Any CPU.ActiveCfg = Release|Any CPU + {EE12B9E6-F116-410E-BD21-1BAA6AA5BB9D}.Release|Any CPU.Build.0 = Release|Any CPU + {EE12B9E6-F116-410E-BD21-1BAA6AA5BB9D}.Release|x64.ActiveCfg = Release|Any CPU + {EE12B9E6-F116-410E-BD21-1BAA6AA5BB9D}.Release|x64.Build.0 = Release|Any CPU + {EE12B9E6-F116-410E-BD21-1BAA6AA5BB9D}.Release|x86.ActiveCfg = Release|Any CPU + {EE12B9E6-F116-410E-BD21-1BAA6AA5BB9D}.Release|x86.Build.0 = Release|Any CPU + {CC74BDCF-6E62-4663-B4B6-E80A3E8DD79F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {CC74BDCF-6E62-4663-B4B6-E80A3E8DD79F}.Debug|Any CPU.Build.0 = Debug|Any CPU + {CC74BDCF-6E62-4663-B4B6-E80A3E8DD79F}.Debug|x64.ActiveCfg = Debug|Any CPU + {CC74BDCF-6E62-4663-B4B6-E80A3E8DD79F}.Debug|x64.Build.0 = Debug|Any CPU + {CC74BDCF-6E62-4663-B4B6-E80A3E8DD79F}.Debug|x86.ActiveCfg = Debug|Any CPU + {CC74BDCF-6E62-4663-B4B6-E80A3E8DD79F}.Debug|x86.Build.0 = Debug|Any CPU + {CC74BDCF-6E62-4663-B4B6-E80A3E8DD79F}.Release|Any CPU.ActiveCfg = Release|Any CPU + {CC74BDCF-6E62-4663-B4B6-E80A3E8DD79F}.Release|Any CPU.Build.0 = Release|Any CPU + {CC74BDCF-6E62-4663-B4B6-E80A3E8DD79F}.Release|x64.ActiveCfg = Release|Any CPU + {CC74BDCF-6E62-4663-B4B6-E80A3E8DD79F}.Release|x64.Build.0 = Release|Any CPU + {CC74BDCF-6E62-4663-B4B6-E80A3E8DD79F}.Release|x86.ActiveCfg = Release|Any CPU + {CC74BDCF-6E62-4663-B4B6-E80A3E8DD79F}.Release|x86.Build.0 = Release|Any CPU + {F93560A3-FC63-4E06-A715-597F0A478740}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {F93560A3-FC63-4E06-A715-597F0A478740}.Debug|Any CPU.Build.0 = Debug|Any CPU + {F93560A3-FC63-4E06-A715-597F0A478740}.Debug|x64.ActiveCfg = Debug|Any CPU + {F93560A3-FC63-4E06-A715-597F0A478740}.Debug|x64.Build.0 = Debug|Any CPU + {F93560A3-FC63-4E06-A715-597F0A478740}.Debug|x86.ActiveCfg = Debug|Any CPU + {F93560A3-FC63-4E06-A715-597F0A478740}.Debug|x86.Build.0 = Debug|Any CPU + {F93560A3-FC63-4E06-A715-597F0A478740}.Release|Any CPU.ActiveCfg = Release|Any CPU + {F93560A3-FC63-4E06-A715-597F0A478740}.Release|Any CPU.Build.0 = Release|Any CPU + {F93560A3-FC63-4E06-A715-597F0A478740}.Release|x64.ActiveCfg = Release|Any CPU + {F93560A3-FC63-4E06-A715-597F0A478740}.Release|x64.Build.0 = Release|Any CPU + {F93560A3-FC63-4E06-A715-597F0A478740}.Release|x86.ActiveCfg = Release|Any CPU + {F93560A3-FC63-4E06-A715-597F0A478740}.Release|x86.Build.0 = Release|Any CPU + {2F9DA2FC-0924-49B4-A517-C67A143D7913}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {2F9DA2FC-0924-49B4-A517-C67A143D7913}.Debug|Any CPU.Build.0 = Debug|Any CPU + {2F9DA2FC-0924-49B4-A517-C67A143D7913}.Debug|x64.ActiveCfg = Debug|Any CPU + {2F9DA2FC-0924-49B4-A517-C67A143D7913}.Debug|x64.Build.0 = Debug|Any CPU + {2F9DA2FC-0924-49B4-A517-C67A143D7913}.Debug|x86.ActiveCfg = Debug|Any CPU + {2F9DA2FC-0924-49B4-A517-C67A143D7913}.Debug|x86.Build.0 = Debug|Any CPU + {2F9DA2FC-0924-49B4-A517-C67A143D7913}.Release|Any CPU.ActiveCfg = Release|Any CPU + {2F9DA2FC-0924-49B4-A517-C67A143D7913}.Release|Any CPU.Build.0 = Release|Any CPU + {2F9DA2FC-0924-49B4-A517-C67A143D7913}.Release|x64.ActiveCfg = Release|Any CPU + {2F9DA2FC-0924-49B4-A517-C67A143D7913}.Release|x64.Build.0 = Release|Any CPU + {2F9DA2FC-0924-49B4-A517-C67A143D7913}.Release|x86.ActiveCfg = Release|Any CPU + {2F9DA2FC-0924-49B4-A517-C67A143D7913}.Release|x86.Build.0 = Release|Any CPU + {74E15915-CE18-42BE-B242-150C35CB4F96}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {74E15915-CE18-42BE-B242-150C35CB4F96}.Debug|Any CPU.Build.0 = Debug|Any CPU + {74E15915-CE18-42BE-B242-150C35CB4F96}.Debug|x64.ActiveCfg = Debug|Any CPU + {74E15915-CE18-42BE-B242-150C35CB4F96}.Debug|x64.Build.0 = Debug|Any CPU + {74E15915-CE18-42BE-B242-150C35CB4F96}.Debug|x86.ActiveCfg = Debug|Any CPU + {74E15915-CE18-42BE-B242-150C35CB4F96}.Debug|x86.Build.0 = Debug|Any CPU + {74E15915-CE18-42BE-B242-150C35CB4F96}.Release|Any CPU.ActiveCfg = Release|Any CPU + {74E15915-CE18-42BE-B242-150C35CB4F96}.Release|Any CPU.Build.0 = Release|Any CPU + {74E15915-CE18-42BE-B242-150C35CB4F96}.Release|x64.ActiveCfg = Release|Any CPU + {74E15915-CE18-42BE-B242-150C35CB4F96}.Release|x64.Build.0 = Release|Any CPU + {74E15915-CE18-42BE-B242-150C35CB4F96}.Release|x86.ActiveCfg = Release|Any CPU + {74E15915-CE18-42BE-B242-150C35CB4F96}.Release|x86.Build.0 = Release|Any CPU + {E9E742E3-F685-4352-98F0-2E7371AE69B1}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {E9E742E3-F685-4352-98F0-2E7371AE69B1}.Debug|Any CPU.Build.0 = Debug|Any CPU + {E9E742E3-F685-4352-98F0-2E7371AE69B1}.Debug|x64.ActiveCfg = Debug|Any CPU + {E9E742E3-F685-4352-98F0-2E7371AE69B1}.Debug|x64.Build.0 = Debug|Any CPU + {E9E742E3-F685-4352-98F0-2E7371AE69B1}.Debug|x86.ActiveCfg = Debug|Any CPU + {E9E742E3-F685-4352-98F0-2E7371AE69B1}.Debug|x86.Build.0 = Debug|Any CPU + {E9E742E3-F685-4352-98F0-2E7371AE69B1}.Release|Any CPU.ActiveCfg = Release|Any CPU + {E9E742E3-F685-4352-98F0-2E7371AE69B1}.Release|Any CPU.Build.0 = Release|Any CPU + {E9E742E3-F685-4352-98F0-2E7371AE69B1}.Release|x64.ActiveCfg = Release|Any CPU + {E9E742E3-F685-4352-98F0-2E7371AE69B1}.Release|x64.Build.0 = Release|Any CPU + {E9E742E3-F685-4352-98F0-2E7371AE69B1}.Release|x86.ActiveCfg = Release|Any CPU + {E9E742E3-F685-4352-98F0-2E7371AE69B1}.Release|x86.Build.0 = Release|Any CPU + {70595303-31C3-4C27-B382-4DA985505546}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {70595303-31C3-4C27-B382-4DA985505546}.Debug|Any CPU.Build.0 = Debug|Any CPU + {70595303-31C3-4C27-B382-4DA985505546}.Debug|x64.ActiveCfg = Debug|Any CPU + {70595303-31C3-4C27-B382-4DA985505546}.Debug|x64.Build.0 = Debug|Any CPU + {70595303-31C3-4C27-B382-4DA985505546}.Debug|x86.ActiveCfg = Debug|Any CPU + {70595303-31C3-4C27-B382-4DA985505546}.Debug|x86.Build.0 = Debug|Any CPU + {70595303-31C3-4C27-B382-4DA985505546}.Release|Any CPU.ActiveCfg = Release|Any CPU + {70595303-31C3-4C27-B382-4DA985505546}.Release|Any CPU.Build.0 = Release|Any CPU + {70595303-31C3-4C27-B382-4DA985505546}.Release|x64.ActiveCfg = Release|Any CPU + {70595303-31C3-4C27-B382-4DA985505546}.Release|x64.Build.0 = Release|Any CPU + {70595303-31C3-4C27-B382-4DA985505546}.Release|x86.ActiveCfg = Release|Any CPU + {70595303-31C3-4C27-B382-4DA985505546}.Release|x86.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(NestedProjects) = preSolution + {2EB698F8-E3A5-4838-B33F-89E71D635D9A} = {32836310-FB5E-5A92-56B4-44D826EF11F5} + {EE12B9E6-F116-410E-BD21-1BAA6AA5BB9D} = {32836310-FB5E-5A92-56B4-44D826EF11F5} + {CC74BDCF-6E62-4663-B4B6-E80A3E8DD79F} = {32836310-FB5E-5A92-56B4-44D826EF11F5} + {F93560A3-FC63-4E06-A715-597F0A478740} = {32836310-FB5E-5A92-56B4-44D826EF11F5} + {2F9DA2FC-0924-49B4-A517-C67A143D7913} = {32836310-FB5E-5A92-56B4-44D826EF11F5} + {74E15915-CE18-42BE-B242-150C35CB4F96} = {32836310-FB5E-5A92-56B4-44D826EF11F5} + {70595303-31C3-4C27-B382-4DA985505546} = {A3A293A0-CC6B-7EBD-D75E-757575894D50} + EndGlobalSection +EndGlobal diff --git a/src/StorageDiscovery/StorageDiscovery/Az.StorageDiscovery.psd1 b/src/StorageDiscovery/StorageDiscovery/Az.StorageDiscovery.psd1 new file mode 100644 index 000000000000..92fe8418d8f6 --- /dev/null +++ b/src/StorageDiscovery/StorageDiscovery/Az.StorageDiscovery.psd1 @@ -0,0 +1,136 @@ +# +# Module manifest for module 'Az.StorageDiscovery' +# +# Generated by: Microsoft Corporation +# +# Generated on: 7/24/2025 +# + +@{ + +# Script module or binary module file associated with this manifest. +# RootModule = '' + +# Version number of this module. +ModuleVersion = '0.1.0' + +# Supported PSEditions +CompatiblePSEditions = 'Core', 'Desktop' + +# ID used to uniquely identify this module +GUID = 'accceef6-8113-453a-a31c-4f2ce57893d6' + +# Author of this module +Author = 'Microsoft Corporation' + +# Company or vendor of this module +CompanyName = 'Microsoft Corporation' + +# Copyright statement for this module +Copyright = 'Microsoft Corporation. All rights reserved.' + +# Description of the functionality provided by this module +Description = 'Microsoft Azure PowerShell: StorageDiscovery cmdlets' + +# Minimum version of the PowerShell engine required by this module +PowerShellVersion = '5.1' + +# Name of the PowerShell host required by this module +# PowerShellHostName = '' + +# Minimum version of the PowerShell host required by this module +# PowerShellHostVersion = '' + +# Minimum version of Microsoft .NET Framework required by this module. This prerequisite is valid for the PowerShell Desktop edition only. +DotNetFrameworkVersion = '4.7.2' + +# Minimum version of the common language runtime (CLR) required by this module. This prerequisite is valid for the PowerShell Desktop edition only. +# ClrVersion = '' + +# Processor architecture (None, X86, Amd64) required by this module +# ProcessorArchitecture = '' + +# Modules that must be imported into the global environment prior to importing this module +RequiredModules = @(@{ModuleName = 'Az.Accounts'; ModuleVersion = '5.1.1'; }) + +# Assemblies that must be loaded prior to importing this module +RequiredAssemblies = 'StorageDiscovery.Autorest/bin/Az.StorageDiscovery.private.dll' + +# Script files (.ps1) that are run in the caller's environment prior to importing this module. +ScriptsToProcess = @() + +# Type files (.ps1xml) to be loaded when importing this module +TypesToProcess = @() + +# Format files (.ps1xml) to be loaded when importing this module +FormatsToProcess = 'StorageDiscovery.Autorest/Az.StorageDiscovery.format.ps1xml' + +# Modules to import as nested modules of the module specified in RootModule/ModuleToProcess +NestedModules = @('StorageDiscovery.Autorest/Az.StorageDiscovery.psm1') + +# Functions to export from this module, for best performance, do not use wildcards and do not delete the entry, use an empty array if there are no functions to export. +FunctionsToExport = 'Get-AzStorageDiscoveryWorkspace', + 'New-AzStorageDiscoveryScopeObject', + 'New-AzStorageDiscoveryWorkspace', + 'Remove-AzStorageDiscoveryWorkspace', + 'Update-AzStorageDiscoveryWorkspace' + +# Cmdlets to export from this module, for best performance, do not use wildcards and do not delete the entry, use an empty array if there are no cmdlets to export. +CmdletsToExport = @() + +# Variables to export from this module +# VariablesToExport = @() + +# Aliases to export from this module, for best performance, do not use wildcards and do not delete the entry, use an empty array if there are no aliases to export. +AliasesToExport = @() + +# DSC resources to export from this module +# DscResourcesToExport = @() + +# List of all modules packaged with this module +# ModuleList = @() + +# List of all files packaged with this module +# FileList = @() + +# Private data to pass to the module specified in RootModule/ModuleToProcess. This may also contain a PSData hashtable with additional module metadata used by PowerShell. +PrivateData = @{ + + PSData = @{ + + # Tags applied to this module. These help with module discovery in online galleries. + Tags = 'Azure', 'ResourceManager', 'ARM', 'PSModule', 'StorageDiscovery' + + # A URL to the license for this module. + LicenseUri = 'https://aka.ms/azps-license' + + # A URL to the main website for this project. + ProjectUri = 'https://github.com/Azure/azure-powershell' + + # A URL to an icon representing this module. + # IconUri = '' + + # ReleaseNotes of this module + # ReleaseNotes = '' + + # Prerelease string of this module + # Prerelease = '' + + # Flag to indicate whether the module requires explicit user acceptance for install/update/save + # RequireLicenseAcceptance = $false + + # External dependent modules of this module + # ExternalModuleDependencies = @() + + } # End of PSData hashtable + +} # End of PrivateData hashtable + +# HelpInfo URI of this module +# HelpInfoURI = '' + +# Default prefix for commands exported from this module. Override the default prefix using Import-Module -Prefix. +# DefaultCommandPrefix = '' + +} + diff --git a/src/StorageDiscovery/StorageDiscovery/ChangeLog.md b/src/StorageDiscovery/StorageDiscovery/ChangeLog.md new file mode 100644 index 000000000000..ad19fa90285c --- /dev/null +++ b/src/StorageDiscovery/StorageDiscovery/ChangeLog.md @@ -0,0 +1,24 @@ + +## Upcoming Release + +## Version 0.1.0 +* First preview release for module Az.StorageDiscovery + diff --git a/src/StorageDiscovery/StorageDiscovery/Properties/AssemblyInfo.cs b/src/StorageDiscovery/StorageDiscovery/Properties/AssemblyInfo.cs new file mode 100644 index 000000000000..f7302e8904c3 --- /dev/null +++ b/src/StorageDiscovery/StorageDiscovery/Properties/AssemblyInfo.cs @@ -0,0 +1,28 @@ +// ---------------------------------------------------------------------------------- +// +// Copyright Microsoft Corporation +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ---------------------------------------------------------------------------------- + +using System; +using System.Reflection; +using System.Runtime.InteropServices; + +[assembly: AssemblyTitle("Microsoft Azure Powershell - StorageDiscovery")] +[assembly: AssemblyCompany(Microsoft.WindowsAzure.Commands.Common.AzurePowerShell.AssemblyCompany)] +[assembly: AssemblyProduct(Microsoft.WindowsAzure.Commands.Common.AzurePowerShell.AssemblyProduct)] +[assembly: AssemblyCopyright(Microsoft.WindowsAzure.Commands.Common.AzurePowerShell.AssemblyCopyright)] + +[assembly: ComVisible(false)] +[assembly: CLSCompliant(false)] +[assembly: Guid("2aa33144-b71d-4836-bee4-d9872d82fbe9")] +[assembly: AssemblyVersion("0.1.0")] +[assembly: AssemblyFileVersion("0.1.0")] diff --git a/src/StorageDiscovery/StorageDiscovery/StorageDiscovery.csproj b/src/StorageDiscovery/StorageDiscovery/StorageDiscovery.csproj new file mode 100644 index 000000000000..25eec6afb3bd --- /dev/null +++ b/src/StorageDiscovery/StorageDiscovery/StorageDiscovery.csproj @@ -0,0 +1,28 @@ + + + + + + + StorageDiscovery + + + + netstandard2.0 + $(AzAssemblyPrefix)$(PsModuleName) + $(AzAssemblyPrefix)$(PsModuleName) + true + false + $(RepoArtifacts)$(Configuration)\Az.$(PsModuleName)\ + $(OutputPath) + + + + + + + + + + + diff --git a/src/StorageDiscovery/StorageDiscovery/help/Az.StorageDiscovery.md b/src/StorageDiscovery/StorageDiscovery/help/Az.StorageDiscovery.md new file mode 100644 index 000000000000..ea015a868e56 --- /dev/null +++ b/src/StorageDiscovery/StorageDiscovery/help/Az.StorageDiscovery.md @@ -0,0 +1,28 @@ +--- +Module Name: Az.StorageDiscovery +Module Guid: accceef6-8113-453a-a31c-4f2ce57893d6 +Download Help Link: https://learn.microsoft.com/powershell/module/az.storagediscovery +Help Version: 1.0.0.0 +Locale: en-US +--- + +# Az.StorageDiscovery Module +## Description +Microsoft Azure PowerShell: StorageDiscovery cmdlets + +## Az.StorageDiscovery Cmdlets +### [Get-AzStorageDiscoveryWorkspace](Get-AzStorageDiscoveryWorkspace.md) +Get a StorageDiscoveryWorkspace + +### [New-AzStorageDiscoveryScopeObject](New-AzStorageDiscoveryScopeObject.md) +Create an in-memory object for StorageDiscoveryScope. + +### [New-AzStorageDiscoveryWorkspace](New-AzStorageDiscoveryWorkspace.md) +Create a StorageDiscoveryWorkspace + +### [Remove-AzStorageDiscoveryWorkspace](Remove-AzStorageDiscoveryWorkspace.md) +Delete a StorageDiscoveryWorkspace + +### [Update-AzStorageDiscoveryWorkspace](Update-AzStorageDiscoveryWorkspace.md) +Update a StorageDiscoveryWorkspace + diff --git a/src/StorageDiscovery/StorageDiscovery/help/Get-AzStorageDiscoveryWorkspace.md b/src/StorageDiscovery/StorageDiscovery/help/Get-AzStorageDiscoveryWorkspace.md new file mode 100644 index 000000000000..e302ea14e496 --- /dev/null +++ b/src/StorageDiscovery/StorageDiscovery/help/Get-AzStorageDiscoveryWorkspace.md @@ -0,0 +1,249 @@ +--- +external help file: Az.StorageDiscovery-help.xml +Module Name: Az.StorageDiscovery +online version: https://learn.microsoft.com/powershell/module/az.storagediscovery/get-azstoragediscoveryworkspace +schema: 2.0.0 +--- + +# Get-AzStorageDiscoveryWorkspace + +## SYNOPSIS +Get a StorageDiscoveryWorkspace + +## SYNTAX + +### List1 (Default) +``` +Get-AzStorageDiscoveryWorkspace [-SubscriptionId ] [-DefaultProfile ] + [] +``` + +### Get +``` +Get-AzStorageDiscoveryWorkspace -Name -ResourceGroupName [-SubscriptionId ] + [-DefaultProfile ] [] +``` + +### List +``` +Get-AzStorageDiscoveryWorkspace -ResourceGroupName [-SubscriptionId ] + [-DefaultProfile ] [] +``` + +### GetViaIdentity +``` +Get-AzStorageDiscoveryWorkspace -InputObject [-DefaultProfile ] + [] +``` + +## DESCRIPTION +Get a StorageDiscoveryWorkspace + +## EXAMPLES + +### Example 1: Get a workspace properties +```powershell +Get-AzStorageDiscoveryWorkspace -Name $workSpaceName -ResourceGroupName $ResourceGroupName +``` + +```output +Description : test workSpace +Id : /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myresourcegroup/providers/Microsoft.StorageDiscovery/storageDiscoveryWorkspaces/myworkspace +Location : eastus2euap +Name : myworkspace +ProvisioningState : Succeeded +ResourceGroupName : myresourcegroup +Scope : {{ + "displayName": "scope1", + "resourceTypes": [ "Microsoft.Storage/storageAccounts" ], + "tagKeysOnly": [ "key1" ], + "tags": { + "tag1": "value1", + "tag2": "value2" + } + }} +Sku : Standard +SystemDataCreatedAt : 7/24/2025 3:30:02 AM +SystemDataCreatedBy : user@microsoft.com +SystemDataCreatedByType : User +SystemDataLastModifiedAt : 7/24/2025 3:30:02 AM +SystemDataLastModifiedBy : user@microsoft.com +SystemDataLastModifiedByType : User +Tag : { + } +Type : microsoft.storagediscovery/storagediscoveryworkspaces +WorkspaceRoot : {/subscriptions/00000000-0000-0000-0000-000000000000} +``` + +The command gets a single workSpace properties with resource group name and workspace name. + +### Example 2: List workspace from subscription +```powershell +Get-AzStorageDiscoveryWorkspace +``` + +```output +Location Name SystemDataCreatedAt SystemDataCreatedBy SystemDataCreatedByType SystemDataLastModifiedAt SystemDataLastModifiedBy SystemDataLastModifiedByType ResourceGroupName +-------- ---- ------------------- ------------------- ----------------------- ------------------------ ------------------------ ---------------------------- ----------------- +eastus2 myworkspace 7/22/2025 10:37:51 AM user@microsoft.com User 7/22/2025 10:37:51 AM user@microsoft.com User myresourcegroup +eastus2 myworkspace2 7/24/2025 3:30:02 AM user@microsoft.com User 7/24/2025 3:42:49 AM user@microsoft.com User myresourcegroup2 +``` + +The command lists workSpaces from the current subscription. + +### Example 3: List workspace from resource group +```powershell +Get-AzStorageDiscoveryWorkspace -ResourceGroupName $ResourceGroupName |fl +``` + +```output +Description : test workSpace +Id : /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myresourcegroup/providers/Microsoft.StorageDiscovery/storageDiscoveryWorkspaces/myworkspace +Location : eastus2euap +Name : myworkspace +ProvisioningState : Succeeded +ResourceGroupName : myresourcegroup +Scope : {{ + "displayName": "scope1", + "resourceTypes": [ "Microsoft.Storage/storageAccounts" ], + "tagKeysOnly": [ "key1" ], + "tags": { + "tag1": "value1", + "tag2": "value2" + } + }} +Sku : Standard +SystemDataCreatedAt : 7/24/2025 3:30:02 AM +SystemDataCreatedBy : user@microsoft.com +SystemDataCreatedByType : User +SystemDataLastModifiedAt : 7/24/2025 3:30:02 AM +SystemDataLastModifiedBy : user@microsoft.com +SystemDataLastModifiedByType : User +Tag : { + } +Type : microsoft.storagediscovery/storagediscoveryworkspaces +WorkspaceRoot : {/subscriptions/00000000-0000-0000-0000-000000000000} + +Description : test workSpace2 +Id : /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myresourcegroup/providers/Microsoft.StorageDiscovery/storageDiscoveryWorkspaces/myworkspace2 +Location : eastus2euap +Name : myworkspace2 +ProvisioningState : Succeeded +ResourceGroupName : myresourcegroup +Scope : {{ + "displayName": "scope2", + "resourceTypes": [ "Microsoft.Storage/storageAccounts" ], + "tagKeysOnly": [ "key2" ], + "tags": { + "tag1": "value1" + } + }} +Sku : Standard +SystemDataCreatedAt : 7/24/2025 3:31:04 AM +SystemDataCreatedBy : user@microsoft.com +SystemDataCreatedByType : User +SystemDataLastModifiedAt : 7/24/2025 3:31:04 AM +SystemDataLastModifiedBy : user@microsoft.com +SystemDataLastModifiedByType : User +Tag : { + } +Type : microsoft.storagediscovery/storagediscoveryworkspaces +WorkspaceRoot : {/subscriptions/00000000-0000-0000-0000-000000000000,/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myresourcegroup} +``` + +The command lists workSpaces from a resource group, and format the output as list. + +## PARAMETERS + +### -DefaultProfile +The DefaultProfile parameter is not functional. +Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. + +```yaml +Type: System.Management.Automation.PSObject +Parameter Sets: (All) +Aliases: AzureRMContext, AzureCredential + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -InputObject +Identity Parameter + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.StorageDiscovery.Models.IStorageDiscoveryIdentity +Parameter Sets: GetViaIdentity +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: True (ByValue) +Accept wildcard characters: False +``` + +### -Name +The name of the StorageDiscoveryWorkspace + +```yaml +Type: System.String +Parameter Sets: Get +Aliases: StorageDiscoveryWorkspaceName + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ResourceGroupName +The name of the resource group. +The name is case insensitive. + +```yaml +Type: System.String +Parameter Sets: Get, List +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -SubscriptionId +The ID of the target subscription. +The value must be an UUID. + +```yaml +Type: System.String[] +Parameter Sets: List1, Get, List +Aliases: + +Required: False +Position: Named +Default value: (Get-AzContext).Subscription.Id +Accept pipeline input: False +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.StorageDiscovery.Models.IStorageDiscoveryIdentity + +## OUTPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.StorageDiscovery.Models.IStorageDiscoveryWorkspace + +## NOTES + +## RELATED LINKS diff --git a/src/StorageDiscovery/StorageDiscovery/help/New-AzStorageDiscoveryScopeObject.md b/src/StorageDiscovery/StorageDiscovery/help/New-AzStorageDiscoveryScopeObject.md new file mode 100644 index 000000000000..fd990270da14 --- /dev/null +++ b/src/StorageDiscovery/StorageDiscovery/help/New-AzStorageDiscoveryScopeObject.md @@ -0,0 +1,135 @@ +--- +external help file: Az.StorageDiscovery-help.xml +Module Name: Az.StorageDiscovery +online version: https://learn.microsoft.com/powershell/module/Az.StorageDiscovery/new-azstoragediscoveryscopeobject +schema: 2.0.0 +--- + +# New-AzStorageDiscoveryScopeObject + +## SYNOPSIS +Create an in-memory object for StorageDiscoveryScope. + +## SYNTAX + +``` +New-AzStorageDiscoveryScopeObject -DisplayName -ResourceType [-Tag ] + [-TagKeysOnly ] [] +``` + +## DESCRIPTION +Create an in-memory object for StorageDiscoveryScope. + +## EXAMPLES + +### Example 1: Create a workspace with discovery scope object +```powershell +$scope1 = New-AzStorageDiscoveryScopeObject -DisplayName "scope1" -ResourceType "Microsoft.Storage/storageAccounts" -TagKeysOnly "key1" -Tag @{"tag1" = "value1"; "tag2" = "value2" } +New-AzStorageDiscoveryWorkspace -Name $workSpaceName -ResourceGroupName $ResourceGroupName -Location $location -WorkspaceRoot $DiscoveryScopeLevel -Sku Standard -Scope $scope1 -Description "test workSpace" +``` + +```output +Description : test workSpace +Id : /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myresourcegroup/providers/Microsoft.StorageDiscovery/storageDiscoveryWorkspaces/myworkspace +Location : eastus2euap +Name : myworkspace +ProvisioningState : Succeeded +ResourceGroupName : myresourcegroup +Scope : {{ + "displayName": "scope1", + "resourceTypes": [ "Microsoft.Storage/storageAccounts" ], + "tagKeysOnly": [ "key1" ], + "tags": { + "tag1": "value1", + "tag2": "value2" + } + }} +Sku : Standard +SystemDataCreatedAt : 7/24/2025 3:30:02 AM +SystemDataCreatedBy : user@microsoft.com +SystemDataCreatedByType : User +SystemDataLastModifiedAt : 7/24/2025 3:30:02 AM +SystemDataLastModifiedBy : user@microsoft.com +SystemDataLastModifiedByType : User +Tag : { + } +Type : microsoft.storagediscovery/storagediscoveryworkspaces +WorkspaceRoot : {/subscriptions/00000000-0000-0000-0000-000000000000} +``` + +The first command creates a discovery scope object, then the second command creates a workspace with the discovery scope object. + +## PARAMETERS + +### -DisplayName +Display name of the collection. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ResourceType +Resource types for the collection. + +```yaml +Type: System.String[] +Parameter Sets: (All) +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Tag +Resource tags. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.StorageDiscovery.Models.ITags +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -TagKeysOnly +The storage account tags keys to filter. + +```yaml +Type: System.String[] +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +## OUTPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.StorageDiscovery.Models.StorageDiscoveryScope + +## NOTES + +## RELATED LINKS diff --git a/src/StorageDiscovery/StorageDiscovery/help/New-AzStorageDiscoveryWorkspace.md b/src/StorageDiscovery/StorageDiscovery/help/New-AzStorageDiscoveryWorkspace.md new file mode 100644 index 000000000000..5a93f23c677b --- /dev/null +++ b/src/StorageDiscovery/StorageDiscovery/help/New-AzStorageDiscoveryWorkspace.md @@ -0,0 +1,306 @@ +--- +external help file: Az.StorageDiscovery-help.xml +Module Name: Az.StorageDiscovery +online version: https://learn.microsoft.com/powershell/module/az.storagediscovery/new-azstoragediscoveryworkspace +schema: 2.0.0 +--- + +# New-AzStorageDiscoveryWorkspace + +## SYNOPSIS +Create a StorageDiscoveryWorkspace + +## SYNTAX + +### CreateExpanded (Default) +``` +New-AzStorageDiscoveryWorkspace -Name -ResourceGroupName [-SubscriptionId ] + -Location [-Description ] [-Scope ] [-Sku ] + [-Tag ] [-WorkspaceRoot ] [-DefaultProfile ] + [-WhatIf] [-Confirm] [] +``` + +### CreateViaJsonFilePath +``` +New-AzStorageDiscoveryWorkspace -Name -ResourceGroupName [-SubscriptionId ] + -JsonFilePath [-DefaultProfile ] [-WhatIf] [-Confirm] + [] +``` + +### CreateViaJsonString +``` +New-AzStorageDiscoveryWorkspace -Name -ResourceGroupName [-SubscriptionId ] + -JsonString [-DefaultProfile ] [-WhatIf] [-Confirm] + [] +``` + +## DESCRIPTION +Create a StorageDiscoveryWorkspace + +## EXAMPLES + +### Example 1: Create a workspace +```powershell +$scope1 = New-AzStorageDiscoveryScopeObject -DisplayName "scope1" -ResourceType "Microsoft.Storage/storageAccounts" -TagKeysOnly "key1" -Tag @{"tag1" = "value1"; "tag2" = "value2" } +New-AzStorageDiscoveryWorkspace -Name $workSpaceName -ResourceGroupName $ResourceGroupName -Location $location -WorkspaceRoot $DiscoveryScopeLevel -Sku Standard -Scope $scope1 -Description "test workSpace" +``` + +```output +Description : test workSpace +Id : /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myresourcegroup/providers/Microsoft.StorageDiscovery/storageDiscoveryWorkspaces/myworkspace +Location : eastus2euap +Name : myworkspace +ProvisioningState : Succeeded +ResourceGroupName : myresourcegroup +Scope : {{ + "displayName": "scope1", + "resourceTypes": [ "Microsoft.Storage/storageAccounts" ], + "tagKeysOnly": [ "key1" ], + "tags": { + "tag1": "value1", + "tag2": "value2" + } + }} +Sku : Standard +SystemDataCreatedAt : 7/24/2025 3:30:02 AM +SystemDataCreatedBy : user@microsoft.com +SystemDataCreatedByType : User +SystemDataLastModifiedAt : 7/24/2025 3:30:02 AM +SystemDataLastModifiedBy : user@microsoft.com +SystemDataLastModifiedByType : User +Tag : { + } +Type : microsoft.storagediscovery/storagediscoveryworkspaces +WorkspaceRoot : {/subscriptions/00000000-0000-0000-0000-000000000000} +``` + +The first command creates a discovery scope object, then the second command creates a workspace with the discovery scope object. + +## PARAMETERS + +### -DefaultProfile +The DefaultProfile parameter is not functional. +Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. + +```yaml +Type: System.Management.Automation.PSObject +Parameter Sets: (All) +Aliases: AzureRMContext, AzureCredential + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Description +The description of the storage discovery workspace + +```yaml +Type: System.String +Parameter Sets: CreateExpanded +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -JsonFilePath +Path of Json file supplied to the Create operation + +```yaml +Type: System.String +Parameter Sets: CreateViaJsonFilePath +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -JsonString +Json string supplied to the Create operation + +```yaml +Type: System.String +Parameter Sets: CreateViaJsonString +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Location +The geo-location where the resource lives + +```yaml +Type: System.String +Parameter Sets: CreateExpanded +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Name +The name of the StorageDiscoveryWorkspace + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: StorageDiscoveryWorkspaceName + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ResourceGroupName +The name of the resource group. +The name is case insensitive. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Scope +The scopes of the storage discovery workspace. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.StorageDiscovery.Models.IStorageDiscoveryScope[] +Parameter Sets: CreateExpanded +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Sku +The storage discovery sku + +```yaml +Type: System.String +Parameter Sets: CreateExpanded +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -SubscriptionId +The ID of the target subscription. +The value must be an UUID. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: (Get-AzContext).Subscription.Id +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Tag +Resource tags. + +```yaml +Type: System.Collections.Hashtable +Parameter Sets: CreateExpanded +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -WorkspaceRoot +The view level storage discovery data estate + +```yaml +Type: System.String[] +Parameter Sets: CreateExpanded +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Confirm +Prompts you for confirmation before running the cmdlet. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: cf + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -WhatIf +Shows what would happen if the cmdlet runs. +The cmdlet is not run. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: wi + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +## OUTPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.StorageDiscovery.Models.IStorageDiscoveryWorkspace + +## NOTES + +## RELATED LINKS diff --git a/src/StorageDiscovery/StorageDiscovery/help/Remove-AzStorageDiscoveryWorkspace.md b/src/StorageDiscovery/StorageDiscovery/help/Remove-AzStorageDiscoveryWorkspace.md new file mode 100644 index 000000000000..bd925923fe25 --- /dev/null +++ b/src/StorageDiscovery/StorageDiscovery/help/Remove-AzStorageDiscoveryWorkspace.md @@ -0,0 +1,179 @@ +--- +external help file: Az.StorageDiscovery-help.xml +Module Name: Az.StorageDiscovery +online version: https://learn.microsoft.com/powershell/module/az.storagediscovery/remove-azstoragediscoveryworkspace +schema: 2.0.0 +--- + +# Remove-AzStorageDiscoveryWorkspace + +## SYNOPSIS +Delete a StorageDiscoveryWorkspace + +## SYNTAX + +### Delete (Default) +``` +Remove-AzStorageDiscoveryWorkspace -Name -ResourceGroupName [-SubscriptionId ] + [-DefaultProfile ] [-PassThru] [-WhatIf] [-Confirm] + [] +``` + +### DeleteViaIdentity +``` +Remove-AzStorageDiscoveryWorkspace -InputObject [-DefaultProfile ] + [-PassThru] [-WhatIf] [-Confirm] [] +``` + +## DESCRIPTION +Delete a StorageDiscoveryWorkspace + +## EXAMPLES + +### Example 1: Remove a workspace +```powershell +Remove-AzStorageDiscoveryWorkspace -Name $workSpaceName -ResourceGroupName $ResourceGroupName +``` + +This command deletes a workspace. + +## PARAMETERS + +### -DefaultProfile +The DefaultProfile parameter is not functional. +Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. + +```yaml +Type: System.Management.Automation.PSObject +Parameter Sets: (All) +Aliases: AzureRMContext, AzureCredential + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -InputObject +Identity Parameter + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.StorageDiscovery.Models.IStorageDiscoveryIdentity +Parameter Sets: DeleteViaIdentity +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: True (ByValue) +Accept wildcard characters: False +``` + +### -Name +The name of the StorageDiscoveryWorkspace + +```yaml +Type: System.String +Parameter Sets: Delete +Aliases: StorageDiscoveryWorkspaceName + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -PassThru +Returns true when the command succeeds + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ResourceGroupName +The name of the resource group. +The name is case insensitive. + +```yaml +Type: System.String +Parameter Sets: Delete +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -SubscriptionId +The ID of the target subscription. +The value must be an UUID. + +```yaml +Type: System.String +Parameter Sets: Delete +Aliases: + +Required: False +Position: Named +Default value: (Get-AzContext).Subscription.Id +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Confirm +Prompts you for confirmation before running the cmdlet. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: cf + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -WhatIf +Shows what would happen if the cmdlet runs. +The cmdlet is not run. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: wi + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.StorageDiscovery.Models.IStorageDiscoveryIdentity + +## OUTPUTS + +### System.Boolean + +## NOTES + +## RELATED LINKS diff --git a/src/StorageDiscovery/StorageDiscovery/help/Update-AzStorageDiscoveryWorkspace.md b/src/StorageDiscovery/StorageDiscovery/help/Update-AzStorageDiscoveryWorkspace.md new file mode 100644 index 000000000000..c550076dac83 --- /dev/null +++ b/src/StorageDiscovery/StorageDiscovery/help/Update-AzStorageDiscoveryWorkspace.md @@ -0,0 +1,315 @@ +--- +external help file: Az.StorageDiscovery-help.xml +Module Name: Az.StorageDiscovery +online version: https://learn.microsoft.com/powershell/module/az.storagediscovery/update-azstoragediscoveryworkspace +schema: 2.0.0 +--- + +# Update-AzStorageDiscoveryWorkspace + +## SYNOPSIS +Update a StorageDiscoveryWorkspace + +## SYNTAX + +### UpdateExpanded (Default) +``` +Update-AzStorageDiscoveryWorkspace -Name -ResourceGroupName [-SubscriptionId ] + [-Description ] [-Scope ] [-Sku ] [-Tag ] + [-WorkspaceRoot ] [-DefaultProfile ] [-WhatIf] + [-Confirm] [] +``` + +### UpdateViaJsonString +``` +Update-AzStorageDiscoveryWorkspace -Name -ResourceGroupName [-SubscriptionId ] + -JsonString [-DefaultProfile ] [-WhatIf] [-Confirm] + [] +``` + +### UpdateViaJsonFilePath +``` +Update-AzStorageDiscoveryWorkspace -Name -ResourceGroupName [-SubscriptionId ] + -JsonFilePath [-DefaultProfile ] [-WhatIf] [-Confirm] + [] +``` + +### UpdateViaIdentityExpanded +``` +Update-AzStorageDiscoveryWorkspace -InputObject [-Description ] + [-Scope ] [-Sku ] [-Tag ] [-WorkspaceRoot ] + [-DefaultProfile ] [-WhatIf] [-Confirm] [] +``` + +## DESCRIPTION +Update a StorageDiscoveryWorkspace + +## EXAMPLES + +### Example 1: Update a workspace +```powershell +$scope2 = New-AzStorageDiscoveryScopeObject -DisplayName "scope2" -ResourceType "Microsoft.Storage/storageAccounts" -TagKeysOnly "test2" -Tag @{"tag3" = "value3" } +Update-AzStorageDiscoveryWorkspace -Name $workSpaceName -ResourceGroupName $RGName -Description "test workSpace2" -Sku Free -Scope $scope2 -WorkspaceRoot $DiscoveryScopeLevel1,$DiscoveryScopeLevel2 -Tag @{"tag4" = "value4"} +``` + +```output +Description : test workSpace2 +Id : /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myresourcegroup/providers/Microsoft.StorageDiscovery/storageDiscoveryWorkspaces/myworkspace +Location : eastus2euap +Name : myworkspace +ProvisioningState : Succeeded +ResourceGroupName : myresourcegroup +Scope : {{ + "displayName": "scope2", + "resourceTypes": [ "Microsoft.Storage/storageAccounts" ], + "tagKeysOnly": [ "test2" ], + "tags": { + "tag3": "value3" + } + }} +Sku : Free +SystemDataCreatedAt : 7/24/2025 3:30:02 AM +SystemDataCreatedBy : user@microsoft.com +SystemDataCreatedByType : User +SystemDataLastModifiedAt : 7/24/2025 3:30:02 AM +SystemDataLastModifiedBy : user@microsoft.com +SystemDataLastModifiedByType : User +Tag : { + "tag4": "value4" + } +Type : microsoft.storagediscovery/storagediscoveryworkspaces +WorkspaceRoot : {/subscriptions/00000000-0000-0000-0000-000000000000,/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myresourcegroup} +``` + +The first command creates a discovery scope object, then the second command updates a workSpace properties. + +## PARAMETERS + +### -DefaultProfile +The DefaultProfile parameter is not functional. +Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. + +```yaml +Type: System.Management.Automation.PSObject +Parameter Sets: (All) +Aliases: AzureRMContext, AzureCredential + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Description +The description of the storage discovery workspace + +```yaml +Type: System.String +Parameter Sets: UpdateExpanded, UpdateViaIdentityExpanded +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -InputObject +Identity Parameter + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.StorageDiscovery.Models.IStorageDiscoveryIdentity +Parameter Sets: UpdateViaIdentityExpanded +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: True (ByValue) +Accept wildcard characters: False +``` + +### -JsonFilePath +Path of Json file supplied to the Update operation + +```yaml +Type: System.String +Parameter Sets: UpdateViaJsonFilePath +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -JsonString +Json string supplied to the Update operation + +```yaml +Type: System.String +Parameter Sets: UpdateViaJsonString +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Name +The name of the StorageDiscoveryWorkspace + +```yaml +Type: System.String +Parameter Sets: UpdateExpanded, UpdateViaJsonString, UpdateViaJsonFilePath +Aliases: StorageDiscoveryWorkspaceName + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ResourceGroupName +The name of the resource group. +The name is case insensitive. + +```yaml +Type: System.String +Parameter Sets: UpdateExpanded, UpdateViaJsonString, UpdateViaJsonFilePath +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Scope +The scopes of the storage discovery workspace. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.StorageDiscovery.Models.IStorageDiscoveryScope[] +Parameter Sets: UpdateExpanded, UpdateViaIdentityExpanded +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Sku +The storage discovery sku + +```yaml +Type: System.String +Parameter Sets: UpdateExpanded, UpdateViaIdentityExpanded +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -SubscriptionId +The ID of the target subscription. +The value must be an UUID. + +```yaml +Type: System.String +Parameter Sets: UpdateExpanded, UpdateViaJsonString, UpdateViaJsonFilePath +Aliases: + +Required: False +Position: Named +Default value: (Get-AzContext).Subscription.Id +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Tag +Resource tags. + +```yaml +Type: System.Collections.Hashtable +Parameter Sets: UpdateExpanded, UpdateViaIdentityExpanded +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -WorkspaceRoot +The view level storage discovery data estate + +```yaml +Type: System.String[] +Parameter Sets: UpdateExpanded, UpdateViaIdentityExpanded +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Confirm +Prompts you for confirmation before running the cmdlet. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: cf + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -WhatIf +Shows what would happen if the cmdlet runs. +The cmdlet is not run. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: wi + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.StorageDiscovery.Models.IStorageDiscoveryIdentity + +## OUTPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.StorageDiscovery.Models.IStorageDiscoveryWorkspace + +## NOTES + +## RELATED LINKS diff --git a/tools/CreateMappings_rules.json b/tools/CreateMappings_rules.json index c37f5ee38a18..f8ac93ef310a 100644 --- a/tools/CreateMappings_rules.json +++ b/tools/CreateMappings_rules.json @@ -987,5 +987,9 @@ { "alias": "CloudHsm", "module": "CloudHsm" + }, + { + "alias": "StorageDiscovery", + "module": "StorageDiscovery" } -] \ No newline at end of file +]