Skip to content

Add PowerShell Script for Resizing and Reclaiming for W365 IT Copilot#38

Merged
bingqiangxiang merged 1 commit intomainfrom
bxiang/AddPowerShellScriptForITCopilot
Jul 2, 2025
Merged

Add PowerShell Script for Resizing and Reclaiming for W365 IT Copilot#38
bingqiangxiang merged 1 commit intomainfrom
bxiang/AddPowerShellScriptForITCopilot

Conversation

@bingqiangxiang
Copy link
Copy Markdown
Collaborator

No description provided.

Copy link
Copy Markdown

Copilot AI left a 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 adds PowerShell automation for resizing and reclaiming Windows 365 Cloud PC licenses, along with sample data and documentation.

  • Introduces a sample CSV for license management.
  • Adds README.md with usage examples and step-by-step screenshots.
  • Implements CloudPcModel class, LicenseManagement.psm1, and Helper.psm1 modules with commands for bulk operations.

Reviewed Changes

Copilot reviewed 5 out of 12 changed files in this pull request and generated 6 comments.

Show a summary per file
File Description
SampleData/SampleDataForLicenseManagement.CSV Added sample records but one row is missing expected fields
README.md New documentation with usage examples and images
Model/CloudPcModel.psm1 Added CloudPcModel class definition
LicenseManagement.psm1 Added Reclaim-CloudPCs and Manage-EntraGroupForResize functions with prompts and Graph API calls
Helper.psm1 Added helper routines for Graph configuration and group/license management
Comments suppressed due to low confidence (5)

Windows365ITCopilot/Helper.psm1:128

  • The .PARAMETER tag names 'CloudPC' but the function parameter is 'CloudPCBasedUrl'. Update the doc to match the actual parameter name.
    .PARAMETER CloudPC

Windows365ITCopilot/Helper.psm1:599

  • Documentation lists 'UseDefaultName' as a parameter, but it isn't defined in the function signature. Remove or correct this entry.
    .PARAMETER UseDefaultName

Windows365ITCopilot/LicenseManagement.psm1:25

  • [nitpick] This new function currently has no associated unit or integration tests. Consider adding tests to validate its behavior.
function Reclaim-CloudPCs {

Windows365ITCopilot/LicenseManagement.psm1:77

  • The nested double quotes inside the Read-Host string will break the prompt. Escape the inner quotes or switch to a single-quoted string.
        $IsUserConsent = Read-Host "`nAre you sure you want to continue? [Y] Yes [N] No (default is "N")"

Windows365ITCopilot/LicenseManagement.psm1:177

  • Same quoting issue here: the inner double quotes break the string literal. Use escaped quotes or single-quoted string.
        $IsUserConsent = Read-Host "`nAre you sure you want to continue? [Y] Yes [N] No (default is "N"): "

Comment thread Windows365ITCopilot/SampleData/SampleDataForLicenseManagement.CSV
Comment thread Windows365ITCopilot/README.md
Comment thread Windows365ITCopilot/LicenseManagement.psm1
Comment thread Windows365ITCopilot/Helper.psm1
Comment thread Windows365ITCopilot/Helper.psm1
Comment thread Windows365ITCopilot/Helper.psm1
@kennywangms kennywangms self-requested a review July 2, 2025 07:50
@bingqiangxiang bingqiangxiang merged commit c6b20e5 into main Jul 2, 2025
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants