This PowerShell module allows you to manage your Windows 365 environment from the command line. It provides a set of cmdlets that allow you to perform various tasks, such as creating, modifying and deleting policies, managing Cloud PCs, and more.
Install-Module -Name PSCloudPC -Verbose
Then import the module into your session
Import-Module PSCloudPC -Verbose -Force
Before you can use the PowerShell Cmdlets within this module you first need to connect and get your authentication headers.
There are two ways to connect
- Interactive
Connect-Windows365 -TenantID <EXAMPLE>.onmicrosoft.com
Note: This is, for now, only available for a Windows Machine because it uses the .NET version for Windows. If you use Linux or Mac and want to connect interactively use the Device Code option.
- Service Principal
Connect-Windows365 -Authtype ServicePrincipal -ClientID <CLIENTID> -ClientSecret <CLIENTSECRET> -TenantID <Example>.onmicrosoft.com
You can use a Service Principal to connect with PowerShell to the Microsoft Graph API. The Service Principal needs the following RestAPI permissions to perform the functions.
Directory.Read.All
DeviceManagementManagedDevices.ReadWrite.All
DeviceManagementConfiguration.ReadWrite.All
CloudPC.ReadWrite.All
- Device Code
Connect-Windows365 -Authtype DeviceCode -TenantID <Example>.onmicrosoft.com
You can use the Device Code to connect interactively for Linux or Mac.
This module provides the following cmdlets:
- Connect-Windows365
- Get-CloudPC
- Get-CPCAzureNetworkConnection
- Get-CPCCustomImage
- Get-CPCGalleryImage
- Get-CPCOrganizationSettings
- Get-CPCProvisioningPolicy
- Get-CPCRestorePoint
- Get-CPCServicePlans
- Get-CPCSupportedRegion
- Get-CPCUserSettingsPolicy
- Invoke-CPCEndGracePeriod
- Invoke-CPCReprovision
- Invoke-CPCRestore
- New-CPCAzureNetworkConnection
- New-CPCCustomImage
- New-CPCProvisioningPolicy
- New-CPCUserSettingsPolicy
- Remove-CPCAzureNetworkConnection
- Remove-CPCCustomImage
- Remove-CPCProvisioningPolicy
- Remove-CPCUserSettingsPolicy
- Set-CPCProvisioningPolicyAssignment
- Set-CPCUserSettingsPolicyAssignment
- Set-GraphVersion
- Update-CPCOrganizationSettings
- Update-CPCProvisioningPolicy
- Update-CPCUserSettingsPolicy