-
Notifications
You must be signed in to change notification settings - Fork 4.1k
Add PowerShell module for DisconnectedOperations #28822
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Add PowerShell module for DisconnectedOperations #28822
Conversation
| Thanks for your contribution! The pull request validation has started. Please revisit this comment for updated status. |
|
/azp run |
|
Azure Pipelines successfully started running 3 pipeline(s). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR introduces the initial scaffolding for the Az.DisconnectedOperations module, which is an AutoRest-generated PowerShell module for managing Azure DisconnectedOperations services. The module follows the standard AutoRest PowerShell project structure with configuration files, utility scripts, test infrastructure, and documentation.
Key Changes:
- Added AutoRest module scaffolding with standard directory structure (custom, test, examples, docs, resources, utils)
- Created configuration files (tsp-location.yaml, .gitignore, .gitattributes) for build and source control
- Added utility scripts for secure string handling and test subscription management
- Established test infrastructure with Pester framework support and environment loading
Reviewed Changes
Copilot reviewed 15 out of 15 changed files in this pull request and generated 8 comments.
Show a summary per file
| File | Description |
|---|---|
| tsp-location.yaml | Defines TypeSpec API specification location with placeholders for commit hash and repository |
| Unprotect-SecureString.ps1 | Utility script to convert SecureString to plaintext for testing scenarios |
| Get-SubscriptionIdTestSafe.ps1 | Helper script to retrieve subscription ID in both test playback and live modes |
| test/loadEnv.ps1 | Test environment loader that reads configuration from JSON files |
| test/README.md | Documentation describing Pester test framework usage and testing modes |
| resources/README.md | Documentation for non-runtime module resources |
| how-to.md | Comprehensive development guide for the module |
| examples/README.md | Documentation for cmdlet usage examples |
| docs/README.md | Documentation for auto-generated help files |
| custom/README.md | Documentation for custom cmdlet implementation |
| custom/Az.DisconnectedOperations.custom.psm1 | Module loader for custom PowerShell cmdlets |
| README.md | Main module documentation with requirements and authentication info |
| Properties/AssemblyInfo.cs | .NET assembly metadata and versioning information |
| .gitignore | Git ignore patterns for build artifacts and generated files |
| .gitattributes | Git line ending configuration |
| // 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. |
Copilot
AI
Nov 7, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Inconsistent license header: Lines 1-3 use MIT License, while lines 4-15 use Apache License 2.0. An assembly should have a single, consistent license header.
Please verify which license is correct and remove the duplicate/incorrect license header.
| // 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. |
| @@ -0,0 +1,16 @@ | |||
| #This script converts securestring to plaintext | |||
Copilot
AI
Nov 7, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The script comment lacks proper formatting. PowerShell script comments that describe functionality should follow comment-based help standards.
Change to:
# This script converts securestring to plaintext| #This script converts securestring to plaintext | |
| # This script converts securestring to plaintext |
| @@ -0,0 +1,5 @@ | |||
| directory: specification/edge/Microsoft.Edge.DisconnectedOperations.Management | |||
| commit: <replace with your value> | |||
Copilot
AI
Nov 7, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The tsp-location.yaml file must use a specific commit hash instead of placeholder text. According to AutoRest README.md guidelines, API specification references should always use specific commit hashes to ensure reproducible builds and prevent breaking changes when the specification repository evolves.
Replace <replace with your value> with an actual commit hash from the specification repository.
| @@ -0,0 +1,5 @@ | |||
| directory: specification/edge/Microsoft.Edge.DisconnectedOperations.Management | |||
| commit: <replace with your value> | |||
| repo: <replace with your value> | |||
Copilot
AI
Nov 7, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The repo field must specify the actual repository URL instead of placeholder text. According to AutoRest README.md guidelines, this should reference the specific repository containing the API specifications (e.g., https://github.com/Azure/azure-rest-api-specs).
Replace <replace with your value> with the actual repository URL.
| if (Test-Path -Path (Join-Path $PSScriptRoot $envFile)) { | ||
| $envFilePath = Join-Path $PSScriptRoot $envFile | ||
| } else { | ||
| $envFilePath = Join-Path $PSScriptRoot '..\$envFile' |
Copilot
AI
Nov 7, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The script uses a backslash in the path string which is Windows-specific. According to PowerShell script guidelines, all scripts must be compatible with Unix-like operating systems (Linux, macOS) and should use cross-platform path handling.
Replace the backslash with Join-Path:
$envFilePath = Join-Path $PSScriptRoot ".." $envFile| } | ||
| $env = @{} | ||
| if (Test-Path -Path $envFilePath) { | ||
| $env = Get-Content (Join-Path $PSScriptRoot $envFile) | ConvertFrom-Json |
Copilot
AI
Nov 7, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The script uses $envFile when it should use $envFilePath. This will cause the script to fail when the environment file is in the parent directory, as it will try to read from $PSScriptRoot instead of the resolved $envFilePath.
Change line 27 to:
$env = Get-Content $envFilePath | ConvertFrom-Json| $env = Get-Content (Join-Path $PSScriptRoot $envFile) | ConvertFrom-Json | |
| $env = Get-Content $envFilePath | ConvertFrom-Json |
| # 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 |
Copilot
AI
Nov 7, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is a spacing issue in the copyright notice. There should be a space between "Generator." and "Changes".
Change to:
// Code generated by Microsoft (R) AutoRest Code Generator. Changes may cause incorrect behavior and will be lost if the code
| # Code generated by Microsoft (R) AutoRest Code Generator.Changes may cause incorrect behavior and will be lost if the code | |
| # Code generated by Microsoft (R) AutoRest Code Generator. Changes may cause incorrect behavior and will be lost if the code |
| // 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 |
Copilot
AI
Nov 7, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is a spacing issue in the copyright notice. There should be a space between "Generator." and "Changes".
Change to:
// Code generated by Microsoft (R) AutoRest Code Generator. Changes may cause incorrect behavior and will be lost if the code
| // Code generated by Microsoft (R) AutoRest Code Generator.Changes may cause incorrect behavior and will be lost if the code | |
| // Code generated by Microsoft (R) AutoRest Code Generator. Changes may cause incorrect behavior and will be lost if the code |
Description
Mandatory Checklist
Please choose the target release of Azure PowerShell. (⚠️ Target release is a different concept from API readiness. Please click below links for details.)
Check this box to confirm: I have read the Submitting Changes section of
CONTRIBUTING.mdand reviewed the following information:ChangeLog.mdfile(s) appropriatelysrc/{{SERVICE}}/{{SERVICE}}/ChangeLog.md.## Upcoming Releaseheader in the past tense.ChangeLog.mdif no new release is required, such as fixing test case only.