### Example 1: Get a client push installation Source: https://learn.microsoft.com/en-us/powershell/module/configurationmanager/get-cmclientpushinstallation Gets the client push installation for the site system server named CMClientPushInstallationPoint.Western.Contoso.com. ```powershell PS XYZ:\> Get-CMClientPushInstallation -SiteSystemServerName "CMClientPushInstallationPoint.Western.Contoso.com" ``` -------------------------------- ### Start-AzStorageMoverJobDefinition example with setup commands Source: https://learn.microsoft.com/en-us/powershell/module/az.storagemover/start-azstoragemoverjobdefinition Shows the full workflow: create a project, container and NFS endpoints, create a job definition, then start it with Start-AzStorageMoverJobDefinition. The output is the resource ID of the started job run. ```powershell New-AzStorageMoverProject -ResourceGroupName myResourceGroup -StorageMoverName myStorageMover -Name myProject -Description "description" New-AzStorageMoverAzStorageContainerEndpoint -Name myContainerEndpoint -ResourceGroupName myResourceGroup -BlobContainerName myContainer -StorageMoverName myStorageMover -StorageAccountResourceId myAccountResourceId New-AzStorageMoverNfsEndpoint -Name myNfsEndpoint -ResourceGroupName myResourceGroup -StorageMoverName myStorageMover -Host "x.x.x.x" -Export "/" -NfsVersion NFSv3 -Description "Description" New-AzStorageMoverJobDefinition -Name myJob -ProjectName myProject -ResourceGroupName myResourceGroup -StorageMoverName myStorageMover -AgentName myAgent -SourceName myNfsEndpoint -TargetName myContainerEndpoint -CopyMode Additive Start-AzStorageMoverJobDefinition -JobDefinitionName myJobDefinition -ProjectName myProject -ResourceGroupName myResourceGroup -StorageMoverName myStorageMover ``` -------------------------------- ### Get-WebsiteState example: get state of a website Source: https://learn.microsoft.com/en-us/powershell/module/webadministration/get-websitestate Example command that gets the state of the 'Default Web Site' and shows the output 'Started'. ```powershell IIS:\> Get-WebsiteState -Name "Default Web Site" Value ----- Started ``` -------------------------------- ### Start-SPServiceInstance Example Source: https://learn.microsoft.com/en-us/powershell/module/microsoft.sharepoint.powershell/start-spserviceinstance Starts the service instance with the given GUID. The GUID is unique to every farm; use Get-SPServiceInstance to find it. ```powershell Start-SPServiceInstance 67877d63-bff4-4521-867a-ef4979ba07ce ``` -------------------------------- ### Example 1: Create resources and get a virtual hub VNet connection Source: https://learn.microsoft.com/en-us/powershell/module/az.network/get-azvirtualhubvnetconnection Creates a resource group, virtual network, virtual WAN, virtual hub, and a virtual hub VNet connection, then calls Get-AzVirtualHubVnetConnection to retrieve the connection. The example shows the full setup chain required before the Get cmdlet can be used. ```powershell New-AzResourceGroup -Location "West US" -Name "testRG" $frontendSubnet = New-AzVirtualNetworkSubnetConfig -Name frontendSubnet -AddressPrefix "10.0.1.0/24" $backendSubnet = New-AzVirtualNetworkSubnetConfig -Name backendSubnet -AddressPrefix "10.0.2.0/24" $remoteVirtualNetwork = New-AzVirtualNetwork -Name "MyVirtualNetwork" -ResourceGroupName "testRG" -Location "West US" -AddressPrefix "10.0.0.0/16" -Subnet $frontendSubnet,$backendSubnet $virtualWan = New-AzVirtualWan -ResourceGroupName "testRG" -Name "myVirtualWAN" -Location "West US" New-AzVirtualHub -VirtualWan $virtualWan -ResourceGroupName "testRG" -Name "westushub" -AddressPrefix "10.0.1.0/24" New-AzVirtualHubVnetConnection -ResourceGroupName "testRG" -VirtualHubName "westushub" -Name "testvnetconnection" -RemoteVirtualNetwork $remoteVirtualNetwork Get-AzVirtualHubVnetConnection -ResourceGroupName ``` -------------------------------- ### Send-Feedback Example Source: https://learn.microsoft.com/en-us/powershell/module/az.accounts/send-feedback Runs the Send-Feedback cmdlet, which starts the guided feedback prompts. ```powershell Send-Feedback ``` -------------------------------- ### Install-SPService Example Source: https://learn.microsoft.com/en-us/powershell/module/microsoft.sharepoint.powershell/install-spservice Installs all services, service instances, and service proxies specified in the registry on the local server computer. ```powershell Install-SPService ``` -------------------------------- ### Client installation properties example Source: https://learn.microsoft.com/en-us/powershell/module/configurationmanager/set-cmclientpushinstallation Specify installation properties for the Configuration Manager client. This example sets management point and logging options, including enabling debug logging and specifying cache size and site code. ```unknown /mp:mp01.contoso.com CCMDEBUGLOGGING="1" CCMLOGGINGENABLED="TRUE" CCMLOGLEVEL="0" CCMLOGMAXHISTORY="5" CCMLOGMAXSIZE="10000000" SMSCACHESIZE="15000" SMSSITECODE="XYZ" SMSMP=mp01.contoso.com ``` -------------------------------- ### Get maintenance schedule by ID Source: https://learn.microsoft.com/en-us/powershell/module/operationsmanager/get-scommaintenanceschedule Example command that retrieves a maintenance schedule using its GUID. The example uses the -Id parameter with a sample GUID. ```powershell PS C:\>Get-SCOMMaintenanceSchedule -Id "32AAB279-3670-ED11-9626-00155D012405" ``` -------------------------------- ### Start-NAVServerInstance Example Source: https://learn.microsoft.com/en-us/powershell/module/microsoft.dynamics.nav.management/start-navserverinstance Starts a Business Central Server instance named 'NavServer' with verbose output. ```powershell Start-NAVServerInstance -ServerInstance NavServer -Verbose ``` -------------------------------- ### Example: Enable keyboard, video, and mouse support Source: https://learn.microsoft.com/en-us/powershell/module/hyper-v/enable-vmconsolesupport Shows how to retrieve virtual machines from a host named Server01 using Get-VM and then enable console support on them with Enable-VMConsoleSupport. ```powershell PS C:\> $VM = Get-VM -ComputerName "Server01" PS C:\> Enable-VMConsoleSupport -VM $VM ``` -------------------------------- ### Get-AzDtlAutoStartPolicy Example Source: https://learn.microsoft.com/en-us/powershell/module/az.devtestlabs/get-azdtlautostartpolicy Example command to get the auto start policy of a lab, using -LabName and -ResourceGroupName parameters. This is an autogenerated example. ```powershell Get-AzDtlAutoStartPolicy -LabName -ResourceGroupName MyResourceGroup ``` -------------------------------- ### Install-SPApp Example Source: https://learn.microsoft.com/en-us/powershell/module/microsoft.sharepoint.powershell/install-spapp Imports an app package and then installs it using the Install-SPApp cmdlet. ```powershell $spapp = Import-SPAppPackage -Path .\feature-upgrade-v1.spapp -Site https://site_url -Source ([microsoft.sharepoint.administration.spappsource]::ObjectModel) Install-SPApp -Web https://site_url -Identity $spapp ``` -------------------------------- ### Get a stamp by ID with Get-SCSPFStamp -ID Source: https://learn.microsoft.com/en-us/powershell/module/spfadmin/get-scspfstamp Gets a stamp by its ID. The ID is a GUID, as shown in the example. ```powershell PS C:\>$Stamp = Get-SCSPFStamp -ID db656655-68ff-4a21-bd1d-0a06bdbc762f ``` -------------------------------- ### Example Output: List Windows Virtual Desktop Start Menu Items Source: https://learn.microsoft.com/en-us/powershell/module/az.desktopvirtualization/get-azwvdstartmenuitem Shows the output of the Get-AzWvdStartMenuItem command, listing start menu items with their names and types. ```text Name Type ---- ---- ApplicationGroupName/Character Map Microsoft.DesktopVirtualization/applicationgroups/startmenuitems ApplicationGroupName/Defragment and Optimize Drives Microsoft.DesktopVirtualization/applicationgroups/startmenuitems ApplicationGroupName/Disk Cleanup Microsoft.DesktopVirtualization/applicationgroups/startmenuitems ApplicationGroupName/Internet Explorer Microsoft.DesktopVirtualization/applicationgroups/startmenuitems ``` -------------------------------- ### Get-SPOFontPackage - Example 2: Get font package by GUID Source: https://learn.microsoft.com/en-us/powershell/module/microsoft.online.sharepoint.powershell/get-spofontpackage Returns the font package with the specified GUID. ```powershell Get-SPOFontPackage -Identity 12345678-1234-1234-1234-123456789012 ``` -------------------------------- ### Complete example of hpcframework.py Source: https://learn.microsoft.com/en-us/powershell/high-performance-computing/hpc-pack-mesos-integration-step-by-step Complete example of starting the HPC Pack Mesos framework with a setup script, setup executable, head node hostname, SSL thumbprint, and client certificate. ```shell pipenv run python hpcframework.py "setupscript.ps1" "setup.exe" "hpcheadnode" "0386B1198B956BBAAA4154153B6CA1F44B6D1016" "HPC2016Comm.pem" ``` -------------------------------- ### Start-SilLogging example Source: https://learn.microsoft.com/en-us/powershell/module/softwareinventorylogging/start-sillogging Starts Software Inventory Logging for the current computer. ```powershell PS C:\> Start-SilLogging ``` -------------------------------- ### Get-WebAppPoolState Example: Get state of DefaultAppPool Source: https://learn.microsoft.com/en-us/powershell/module/webadministration/get-webapppoolstate Gets the run-time state of the DefaultAppPool. The output shows the state value 'Started'. ```powershell IIS:\> Get-WebAppPoolState -Name "DefaultAppPool" Value ----- Started ``` -------------------------------- ### Start-SbecInstance Source: https://learn.microsoft.com/en-us/powershell/module/booteventcollector/start-sbecinstance Starts the Setup and Boot Event Collector service. Requires Builtin Administrator privilege. ```APIDOC ## Start-SbecInstance ### Description Starts the Setup and Boot Event Collector service. You must have the Builtin Administrator privilege to run this command. ### Syntax ``` Start-SbecInstance [-Service] [-PassThru] [] ``` ### Parameters #### -Service - Type: SwitchParameter - Mandatory: True - Position: Named - Description: Starts the Setup and BEC service on the current computer. #### -PassThru - Type: SwitchParameter - Mandatory: False - Position: Named - Description: Returns an object representing the started service. By default, this cmdlet does not generate any output. #### CommonParameters This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutBuffer, -OutVariable, -PipelineVariable, -ProgressAction, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters. ### Examples #### Example 1: Start the Boot Event Collector ```powershell PS C:\> Start-SbecInstance -Service ``` This command starts the Boot Event Collector service. ### Inputs None. ### Outputs ServiceController ### Related Links - Get-SbecActiveConfig - Set-SbecActiveConfig - Stop-SbecInstance - Test-SbecActiveConfig ``` -------------------------------- ### Example 2: Start the server by identity Source: https://learn.microsoft.com/en-us/powershell/module/az.postgresql/start-azpostgresqlflexibleserver Starts a flexible server using an identity object. The example constructs an identity string with a subscription ID and resource path, then passes it to -InputObject. ```powershell $ID = "/subscriptions//resourceGroups/PowershellPostgreSqlTest/providers/Microsoft.DBforPostgreSQL/flexibleServers/postgresql-test/start" Start-AzPostgreSqlFlexibleServer -InputObject $ID ``` -------------------------------- ### Start the Boot Event Collector Source: https://learn.microsoft.com/en-us/powershell/module/booteventcollector/start-sbecinstance Example demonstrating how to start the Boot Event Collector service. ```powershell PS C:\> Start-SbecInstance -Service ``` -------------------------------- ### Get Server Features Example Source: https://learn.microsoft.com/en-us/powershell/module/servermanagertasks/get-smserverfeature Retrieves the server features installed on the local server. This is the basic usage example from the documentation. ```powershell PS C:\>Get-SMServerFeature ``` -------------------------------- ### NuGet provider installation prompt output Source: https://learn.microsoft.com/en-us/powershell/gallery/how-to/getting-support/bootstrapping-nuget Example output shown when installing PowerShellGet prompts to install the NuGet provider. Answering Y installs the provider and nuget.exe if necessary. ```output NuGet provider is required to continue PowerShellGet requires NuGet provider version '2.8.5.201' or newer to interact with NuGet -based repositories. The NuGet provider must be available in 'C:\Program Files\PackageMan agement\ProviderAssemblies' or 'C:\Users\user1\AppData\Local\PackageManagement\ProviderAs semblies'. You can also install the NuGet provider by running 'Install-PackageProvider -N ame NuGet -MinimumVersion 2.8.5.201 -Force'. Do you want PowerShellGet to install and imp ort the NuGet provider now? [Y] Yes [N] No [S] Suspend [?] Help (default is "Y"): Y VERBOSE: Installing NuGet provider. ``` -------------------------------- ### Get all application settings for an application installed on a virtual machine Source: https://learn.microsoft.com/en-us/powershell/module/virtualmachinemanager/get-scapplicationsetting Retrieves application settings for an application installed on a virtual machine. The example gets a virtual machine, its applications, and then the settings for the first application. ```powershell PS C:\> $VM = Get-SCVirtualMachine "VM01" PS C:\> $Apps = Get-SCApplication -VM $VM PS C:\> $AppSetting = Get-SCApplicationSetting -ApplicationDeployment $Apps[0] ``` -------------------------------- ### Import an install image and create a multicast transmission with manual start Source: https://learn.microsoft.com/en-us/powershell/module/wds/import-wdsinstallimage Imports an install image and creates a multicast transmission that must be started manually. ```powershell PS C:\>Import-WdsInstallImage -Path "D:\images\install.wim" -ImageName "Fabrikam Latest with LOB apps" -ImageGroup "Fabrikam Latest Images" -Multicast -ManualStart -TransmissionName "Fabrikam Latest ScheduledCast with manual start" ``` -------------------------------- ### Install a product key Source: https://learn.microsoft.com/en-us/powershell/module/vamt/install-vamtproductkey Gets a product by fully qualified domain name and installs a product key on it. ```powershell PS C:\> $Product = Get-VamtProduct | where { $_.fullyqualifieddomainname -eq 'mymachine' } PS C:\> Install-VamtProductKey -Products $Product -ProductKey "12345-67890-12345-67890-12345" ``` -------------------------------- ### Install-Dtc Example: Install DTC with LogPath and StartType Source: https://learn.microsoft.com/en-us/powershell/module/msdtc/install-dtc Installs local DTC with a specified log path and start type AutoStart. ```powershell PS C:\> Install-Dtc -LogPath "C:\log" -StartType "AutoStart" ``` -------------------------------- ### Create and insert Install Application step in task sequence Source: https://learn.microsoft.com/en-us/powershell/module/configurationmanager/new-cmtsstepinstallapplication This example creates a new Install Application step and inserts it at index 11 in a task sequence. It first retrieves an application object named 'Central app', then builds the step with that application, retrieves the task sequence named 'Default OS deployment', and finally adds the step at the specified index. ```powershell $app = Get-CMApplication -Name "Central app" $step = New-CMTSStepInstallApplication -Name "Install Application" -Application $app $tsNameOsd = "Default OS deployment" $tsOsd = Get-CMTaskSequence -Name $tsNameOsd -Fast $tsOsd | Add-CMTaskSequenceStep -Step $step -InsertStepStartIndex 11 ``` -------------------------------- ### Start BPA scan on all models via pipeline Source: https://learn.microsoft.com/en-us/powershell/module/bestpractices/invoke-bpamodel Gets all installed BPA models and pipes them to Invoke-BPAModel to start a scan on all models. ```powershell PS C:\> Get-BPAModel | Invoke-BPAModel ``` -------------------------------- ### Enable your device for development example Source: https://learn.microsoft.com/en-us/powershell/module/windowsdeveloperlicense/show-windowsdeveloperlicenseregistration Example command that opens a dialog box to enable your device for development. ```powershell PS C:\> Show-WindowsDeveloperLicenseRegistration ``` -------------------------------- ### Install-AzStackHCIRemoteSupport example Source: https://learn.microsoft.com/en-us/powershell/module/az.stackhci/install-azstackhciremotesupport Runs the Install-AzStackHCIRemoteSupport cmdlet to install Remote Support. ```powershell Install-AzStackHCIRemoteSupport ``` -------------------------------- ### Get-AppxLog -All example Source: https://learn.microsoft.com/en-us/powershell/module/appx/get-appxlog Gets all the app package installation logs on the computer. ```powershell Get-AppxLog -All ``` -------------------------------- ### Start Azure Nodes Example Source: https://learn.microsoft.com/en-us/powershell/module/hpcpack2016/start-hpcnodeset Gets the node template named MyWorkerNodeTemplate and starts all associated Azure nodes asynchronously, returning without waiting for the nodes to start. ```powershell PS C:\>Get-HpcNodeTemplate -Name "MyWorkerNodeTemplate" | Start-HpcNodeSet -Async $True ``` -------------------------------- ### Example 1: Initialize infrastructure for migrate project Source: https://learn.microsoft.com/en-us/powershell/module/az.migrate/initialize-azmigratereplicationinfrastructure Initialises the infrastructure for a migrate project using the default scenario. The output is True. ```powershell Initialize-AzMigrateReplicationInfrastructure -ResourceGroupName TestRG -ProjectName TestProject -TargetRegion centralus ``` ```text True ``` -------------------------------- ### Example 4: Get configuration settings for the Change Request feature using GUID Source: https://learn.microsoft.com/en-us/powershell/module/system.center.service.manager/get-scsmsetting Retrieves configuration settings for the Service Manager Change Request feature by first getting the GUID of the settings and then using it with Get-SCSMSetting. ```powershell PS C:\>("Change Request Settings" | Get-SCSMSetting ).__EnterpriseManagementObject.Id | Get-SCSMSetting DisplayName : Change Request Settings MaxFileAttachmentsCount : 10 MaxFileAttachmentSizeinKB : 64 SystemWorkItemChangeRequestIdPrefix : CR ``` -------------------------------- ### Example 1: List all application settings of a static site build Source: https://learn.microsoft.com/en-us/powershell/module/az.websites/get-azstaticwebappbuildfunctionappsetting Lists all application settings for a static site build using the specified resource group, static web app name, and environment name. ```powershell Get-AzStaticWebAppBuildFunctionAppSetting -ResourceGroupName azure-rg-test -Name staticweb-portal04 -EnvironmentName 'default' ``` ```text Kind Name Type ---- ---- ---- appsettings Microsoft.Web/staticSites/builds/config/functionappsettings ``` -------------------------------- ### Example 2: Get all virtual network taps using filtering Source: https://learn.microsoft.com/en-us/powershell/module/az.network/get-azvirtualnetworktap Gets all virtual network taps whose names start with 'VirtualTap'. ```powershell Get-AzVirtualNetworkTap -Name "VirtualTap*" ``` -------------------------------- ### Get-DataGatewayClusterDatasourceStatus Example Source: https://learn.microsoft.com/en-us/powershell/module/datagateway/get-datagatewayclusterdatasourcestatus Example command that gets the status of a Power BI single datasource on the specified gateway cluster. Uses the GatewayClusterId and GatewayClusterDatasourceId parameters with example GUID values. ```powershell PS C:\> Get-DataGatewayClusterDatasourceStatus -GatewayClusterId DC8F2C49-5731-4B27-966B-3DB5094C2E77 -GatewayClusterDatasourceId 64C574B7-86C6-4560-B710-40AC18990804 ``` -------------------------------- ### Get-ProvisioningPackage - Example 1 Source: https://learn.microsoft.com/en-us/powershell/module/provisioning/get-provisioningpackage Example command that retrieves information about the provisioning package at the specified path. ```powershell PS C:\> Get-ProvisioningPackage -PackagePath c:\test\testppkg.ppkg ``` -------------------------------- ### Start-NAVServerInstance Source: https://learn.microsoft.com/en-us/powershell/module/microsoft.dynamics.nav.management Starts a Business Central Server instance. ```APIDOC ## Start-NAVServerInstance ### Description Starts a Business Central Server instance. ### Syntax Start-NAVServerInstance ### Parameters None documented. ### Examples No examples provided. ### Outputs None documented. ### Notes This cmdlet is part of the Microsoft.BusinessCentral.Management module. ``` -------------------------------- ### Get installed state of packages with dsc resource get Source: https://learn.microsoft.com/en-us/powershell/gallery/powershellget/dsc/how-to/invoke-resources Use the Get operation of the PSResourceList resource to return the installed state for each listed package. The example queries three packages from the PSGallery repository, including a version range for Pester. Output shows installed packages with version and scope, while uninstalled packages are returned with `_exist: false`. ```powershell $type = 'Microsoft.PowerShell.PSResourceGet/PSResourceList' $instance = @{ repositoryName = 'PSGallery' resources = @( @{ name = 'PSScriptAnalyzer' } @{ name = 'Pester'; version = '[5.0.0, )' } @{ name = 'Microsoft.PowerShell.PlatyPS' } ) } | ConvertTo-Json -Compress -Depth 3 dsc resource get --resource $type --input $instance ``` ```yaml actualState: repositoryName: PSGallery resources: - name: PSScriptAnalyzer version: 1.24.0 scope: CurrentUser repositoryName: PSGallery preRelease: false _exist: true - name: Pester version: 5.7.1 scope: AllUsers repositoryName: PSGallery preRelease: false _exist: true - name: Microsoft.PowerShell.PlatyPS _exist: false ``` -------------------------------- ### Start-AzsBackup Example 1: Start azurestack backup Source: https://learn.microsoft.com/en-us/powershell/module/azs.backup.admin/start-azsbackup Runs the Start-AzsBackup cmdlet to start an Azure Stack backup. ```powershell PS C:\>Start-AzsBackup ``` -------------------------------- ### Example 1: Get the install behaviors for a specific deployment type Source: https://learn.microsoft.com/en-us/powershell/module/configurationmanager/get-cmdeploymenttypeinstallbehavior This example lists the install behaviors for an MSI deployment type of the CenterApp application. It first retrieves the deployment type object using Get-CMDeploymentType, then passes it to Get-CMDeploymentTypeInstallBehavior. ```powershell $appName = "CenterApp" $dtName = "InterDept - Windows Installer (.msi file)" $msi_dt = Get-CMDeploymentType -ApplicationName $appName -DeploymentTypeName $dtName Get-CMDeploymentTypeInstallBehavior -InputObject $msi_dt ``` -------------------------------- ### Get all user's whiteboards (Example 1) Source: https://learn.microsoft.com/en-us/powershell/module/whiteboardadmin/get-whiteboard Retrieves all whiteboards for a user specified by their user ID. The example uses a placeholder GUID for the user ID. ```powershell Get-Whiteboard -UserId 00000000-0000-0000-0000-000000000001 ``` -------------------------------- ### Example 1: Set up the init container definition Source: https://learn.microsoft.com/en-us/powershell/module/az.containerinstance/new-azcontainerinstanceinitdefinitionobject Creates an init container definition with the name 'initDefinition' and the command '/bin/sh -c myscript.sh'. The output shows the resulting object's Name property. ```powershell New-AzContainerInstanceInitDefinitionObject -Name "initDefinition" -Command "/bin/sh -c myscript.sh" ``` ```text Name ---- initDefinition ``` -------------------------------- ### Example 1: Create a website Source: https://learn.microsoft.com/en-us/powershell/module/webadministration/new-website Creates a website named TestSite on port 80 with a host header and physical path. ```powershell IIS:\> New-WebSite -Name "TestSite" -Port 80 -HostHeader "TestSite" -PhysicalPath "$Env:systemdrive\inetpub\testsite" ``` -------------------------------- ### Get start time for catalog pruning Source: https://learn.microsoft.com/en-us/powershell/module/dataprotectionmanager/get-dpmmaintenancejobstarttime Example command that retrieves the scheduled start time for the CatalogPruning maintenance job on the DPM server named TestServer. ```powershell PS C:\> Get-DPMMaintenanceJobStartTime -DPMServerName "TestServer" -MaintenanceJob CatalogPruning ``` -------------------------------- ### Get continuous web job by pipeline Source: https://learn.microsoft.com/en-us/powershell/module/az.websites/get-azwebappslotcontinuouswebjob Gets a continuous web job by passing its ID through the pipeline. The example first retrieves the web job object, starts it, then uses the ID to get the job again. ```powershell $webjob = Get-AzWebAppSlotContinuousWebJob -ResourceGroupName webjob-rg-test -AppName appService-test01 -SlotName slot01 -Name slotcontinuousjob-03 Start-AzWebAppSlotContinuousWebJob -ResourceGroupName webjob-rg-test -AppName appService-test01 -SlotName slot01 -Name slotcontinuousjob-03 $webjob.Id | Get-AzWebAppSlotContinuousWebJob ``` ```text Name Kind WebJobType ResourceGroupName ---- ---- ---------- ----------------- appService-test01/slot01/slotcontinuousjob-03 webjob-rg-test ``` -------------------------------- ### Install-SPApplicationContent Example Source: https://learn.microsoft.com/en-us/powershell/module/microsoft.sharepoint.powershell/install-spapplicationcontent Runs the Install-SPApplicationContent cmdlet to copy data to a Web application in the existing folders. ```powershell Install-SPApplicationContent ``` -------------------------------- ### Install-ProvisioningPackage Example 1 Source: https://learn.microsoft.com/en-us/powershell/module/provisioning/install-provisioningpackage Installs the mypackage.ppkg file silently without customer interaction using the -QuietInstall switch. ```powershell PS C:\> Install-ProvisioningPackage -PackagePath C:\mypackage.ppkg -QuietInstall ``` -------------------------------- ### Example 2: Get a tenant user role by ID Source: https://learn.microsoft.com/en-us/powershell/module/spfadmin/get-scspftenantuserrole Retrieves a tenant user role by its GUID. ```powershell PS C:\>$TenantUserRoles = Get-SCSPFTenantUserRole -ID e6f9f901-2883-4478-a64e-00c58a423516 ``` -------------------------------- ### Open-WmsVirtualDesktop example: open a window to a virtual desktop template Source: https://learn.microsoft.com/en-us/powershell/module/multipointvdi/open-wmsvirtualdesktop Example command that opens a window connected to the virtual desktop template with the specified GUID. ```powershell PS C:\> Open-WmsVirtualDesktop -TemplateVirtualMachineGuid "53F56307-B6BF-11D0-94F2-00A0C91EFB8B" ``` -------------------------------- ### Get ODBC drivers with name starting with SQL Server on 64-bit platform Source: https://learn.microsoft.com/en-us/powershell/module/wdac/get-odbcdriver Retrieves installed ODBC drivers whose name starts with 'SQL Server' on the 64-bit platform. ```powershell PS C:\> Get-OdbcDriver -Name "SQL Server*" -Platform "64-bit" ``` -------------------------------- ### Get-Ual Example Source: https://learn.microsoft.com/en-us/powershell/module/useraccesslogging/get-ual Example command that gets the UAL startup status for the current server. The output shows that UAL is disabled (Enabled = False), meaning it will not start on the next restart. ```powershell PS C:\>Get-Ual Enabled PSComputerName ------- -------------- False ``` -------------------------------- ### Install-NfsMappingStore example with output Source: https://learn.microsoft.com/en-us/powershell/module/nfs/install-nfsmappingstore Installs the AD LDS role and creates an AD LDS instance named NFSMappingStore on port 389, with partition CN=nfs,DC=nfs. The output confirms the instance creation and its settings. ```powershell PS C:\> Install-NfsMappingStore -InstanceName "NFSMappingStore" -LdapPort 389 Successfully created ADLDS instance named NFSMappingStore on server NfsServer01. The instance is running on port 389 and the partition is CN=nfs,DC=nfs. ``` -------------------------------- ### Example 1: Start the server by resource name Source: https://learn.microsoft.com/en-us/powershell/module/az.postgresql/start-azpostgresqlflexibleserver Starts a flexible server using the resource group name and server name. The example uses resource group 'PowershellPostgreSqlTest' and server 'postgresql-test'. ```powershell Start-AzPostgreSqlFlexibleServer -ResourceGroupName PowershellPostgreSqlTest -Name postgresql-test ``` -------------------------------- ### Example 2: Start all tasks in a folder Source: https://learn.microsoft.com/en-us/powershell/module/scheduledtasks/start-scheduledtask Uses Get-ScheduledTask to get the full task path for the UpdateVirus folder and pipes that value to Start-ScheduledTask, which starts all tasks in the UpdateVirus folder. ```powershell PS C:\>Get-ScheduledTask -TaskPath "\UpdateTasks\UpdateVirus\" | Start-ScheduledTask ``` -------------------------------- ### Start-EUDBMigration -EnvironmentName (Example 1) Source: https://learn.microsoft.com/en-us/powershell/module/microsoft.powerapps.administration.powershell/start-eudbmigration Starts migration of all non-compliant flows in the specified environment. The environment is identified by its GUID. ```powershell Start-EUDBMigration -EnvironmentName 00aa00aa-bb11-cc22-dd33-44ee44ee44ee ``` -------------------------------- ### Example 2: Get a trusted issuer by ID Source: https://learn.microsoft.com/en-us/powershell/module/spfadmin/get-scspftrustedissuer Retrieves a trusted issuer by its GUID and stores it in the $TrustedIssuer variable. ```powershell PS C:\>$TrustedIssuer = Get-SCSPFTrustedIssuer -ID c9f59be2-dce5-4221-ad60-2204dc457bd8 ``` -------------------------------- ### Start-AzJitNetworkAccessPolicy example Source: https://learn.microsoft.com/en-us/powershell/module/az.security/start-azjitnetworkaccesspolicy Retrieves a VM resource, builds a JIT policy object with port 22, a 1-hour end time, and an allowed source address prefix, then starts the policy. The public IP is not shown in the example. ```powershell $MyResource = Get-AzResource -Id /subscriptions/xxxxxxx-xxxxx-xxxxx-xxxxxxx/resourceGroups/PolicyDemo/providers/Microsoft.Compute/virtualMachines/PolicyDemoVM1 $JitPolicy = (@{ id = $MyResource.ResourceId; ports = (@{ number = 22 endTimeUtc = Get-Date (Get-Date -AsUTC).AddHours(1) -Format O allowedSourceAddressPrefix = @($MyPublicIP) }) }) $ActivationVM = @($JitPolicy) Start-AzJitNetworkAccessPolicy -ResourceGroupName $($MyResource.ResourceGroupName) -Location $MyResource.Location -Name "default" -VirtualMachine $ActivationVM ``` -------------------------------- ### Get-SCSPFSetting example - Get a setting by ID Source: https://learn.microsoft.com/en-us/powershell/module/spfadmin/get-scspfsetting Retrieves an existing setting by its GUID and stores the result in the $Setting variable. ```powershell PS C:\>$Setting = Get-SCSPFSetting -ID f3b39608-ac58-40b7-853c-241e343b256a ``` -------------------------------- ### Example 1: Get encryption status by workspace ID Source: https://learn.microsoft.com/en-us/powershell/module/microsoftpowerbimgmt.admin/get-powerbiworkspaceencryptionstatus Retrieves encryption status for the workspace with the specified GUID. ```powershell PS C:\> Get-PowerBIWorkspaceEncryptionStatus -Id '101be2ef-c88a-4291-9322-7e9b89ab665f' ``` -------------------------------- ### Get-SmbServerCertProps Example Output Source: https://learn.microsoft.com/en-us/powershell/module/smbshare/get-smbservercertprops Shows the output of the example command, including certificate properties and the Test-Certificate result. ```text Checking Mapping '2025-srv-01.corp.contoso.com'..... SMBServerCertificateMappingName : 2025-srv-01.corp.contoso.com SelfSigned : True SubjectName : System.Security.Cryptography.X509Certificates.X500DistinguishedName Subject : CN=2025-srv-01 SubjectOid : System.Security.Cryptography.Oid SubjectRawData : {48, 21, 49, 19...} FriendlyName : SignatureAlgorithm : 1.2.840.113549.1.1.11 sha256RSA Thumbprint : 88032B3551FAF7DE26EFFFF814AA086E3DBD2A4F NotBefore : 8/20/2021 3:02:16 PM NotAfter : 8/20/2022 3:02:16 PM SendAsTrustedIssuer : False PublicKey : System.Security.Cryptography.X509Certificates.PublicKey DnsNameList : {2025-srv-01.corp.contoso.com, fs1.contoso.com} Test-Certificate result : PASS RenewalChain: Testing certificates in the RenewalChain..... ``` -------------------------------- ### Example 2: Get Virtual WANs with wildcard Source: https://learn.microsoft.com/en-us/powershell/module/az.network/get-azvirtualwan Gets all Virtual WANs whose name starts with 'test'. The output shows two Virtual WANs (test1 and test2) with their properties. ```powershell Get-AzVirtualWan -Name test* ``` ```text Name : test1 Id : /subscriptions/{SubscriptionId}/resourceGroups/testRG/providers/Microsoft.Network/virtualWans/test1 AllowVnetToVnetTraffic : False AllowBranchToBranchTraffic : True Location : West US Type : Microsoft.Network/virtualWans ProvisioningState : Succeeded Name : test2 Id : /subscriptions/{SubscriptionId}/resourceGroups/testRG/providers/Microsoft.Network/virtualWans/test2 AllowVnetToVnetTraffic : False AllowBranchToBranchTraffic : True Location : West US Type : Microsoft.Network/virtualWans ProvisioningState : Succeeded ``` -------------------------------- ### Install and run the GetProcessSample01 sample Source: https://learn.microsoft.com/en-us/powershell/scripting/developer/cmdlet/getprocesssample01-sample Steps to install the sample DLL and run the Get-Proc cmdlet. Requires Windows PowerShell 1.0 or later. ```powershell installutil "GetProcessSample01.dll" ``` ```powershell Add-PSSnapin GetProcPSSnapIn01 ``` ```powershell Get-Proc ``` -------------------------------- ### Get alert details by ID Source: https://learn.microsoft.com/en-us/powershell/module/az.alertsmanagement/get-azalert Gets alert details by Id (GUID) or Resource Id (Complete ARM Id). The example pipes the result to Format-List to display full details. ```powershell Get-AzAlert -AlertId "afbf1b3a-0a6c-4f19-9c9b-644ccd7b1529" | Format-List ``` -------------------------------- ### Set-CMTSStepSetupWindowsAndConfigMgr example Source: https://learn.microsoft.com/en-us/powershell/module/configurationmanager/set-cmtsstepsetupwindowsandconfigmgr Changes the Setup Windows and ConfigMgr step in the Default OS deployment task sequence to use a pre-production client package. Uses the -PreproductionPackageId parameter. ```powershell $tsNameOsd = "Default OS deployment" $tsStepNameSetupWinCM = "Setup Windows and ConfigMgr" Set-CMTSStepSetupWindowsAndConfigMgr -TaskSequenceName $tsNameOsd -StepName $tsStepNameSetupWinCM -PreproductionPackageId "XYZ00045" ``` -------------------------------- ### Example 1: Start Azure nodes Source: https://learn.microsoft.com/en-us/powershell/module/hpcpack2019/start-hpcnodeset Starts all nodes associated with the MyWorkerNodeTemplate node template. The command gets the node template object and pipes it to Start-HpcNodeSet with -Async $True, so the command returns without waiting for the nodes to start. ```powershell PS C:\>Get-HpcNodeTemplate -Name "MyWorkerNodeTemplate" | Start-HpcNodeSet -Async $True ``` -------------------------------- ### Example 1: List SKUs in a subscription Source: https://learn.microsoft.com/en-us/powershell/module/az.devcenter/get-azdevcenteradminsku Example command that lists SKUs in the current subscription. ```powershell Get-AzDevCenterAdminSku ``` -------------------------------- ### Install a local MCP server Source: https://learn.microsoft.com/en-us/powershell/utility-modules/aishell/how-to/mcp-support The following example installs the `@modelcontextprotocol/server-everything` and `@modelcontextprotocol/server-files` MCP servers using npm. ```bash npm install -g @modelcontextprotocol/server-everything @modelcontextprotocol/server-files ``` -------------------------------- ### Get-MsmqOutgoingQueue -Name Example Source: https://learn.microsoft.com/en-us/powershell/module/msmq/get-msmqoutgoingqueue Gets all outgoing message queues local to the current computer whose names start with 'Order'. ```powershell PS C:\> Get-MsmqOutgoingQueue -Name "Order*" ``` -------------------------------- ### Example: List Windows Virtual Desktop Start Menu Items Source: https://learn.microsoft.com/en-us/powershell/module/az.desktopvirtualization/get-azwvdstartmenuitem Lists start menu items in an application group using the Get-AzWvdStartMenuItem cmdlet with required parameters. ```powershell Get-AzWvdStartMenuItem -ResourceGroupName ResourceGroupName -ApplicationGroupName ApplicationGroupName ``` -------------------------------- ### Get-SmaModule example: Get a module by ID Source: https://learn.microsoft.com/en-us/powershell/module/microsoft.systemcenter.servicemanagementautomation/get-smamodule Retrieves the module with the specified GUID from the SMA web service at the given endpoint. ```powershell PS C:\> Get-SmaModule -WebServiceEndpoint "https://contoso.com/app01" -Id "a65bba12-792b-44e8-8a50-1c3e40c34031" ``` -------------------------------- ### Get-SPEnterpriseSearchQueryKeyword Example Source: https://learn.microsoft.com/en-us/powershell/module/microsoft.sharepoint.powershell/get-spenterprisesearchquerykeyword Gets a reference to the keyword 'Engineering' from the specified site and sets its start and end dates using Set-SPEnterpriseSearchQueryKeyword. ```powershell Get-SPEnterpriseSearchQueryKeyword -Identity Engineering -Site https://myserver/sites/engineering | Set-SPEnterpriseSearchQueryKeyword -StartDate "12/25/2009" -EndDate "12/24/2010" -Site https://myserver/sites/engineering ``` -------------------------------- ### Create a directory or tenant-level setting with New-MgBetaDirectorySetting Source: https://learn.microsoft.com/en-us/powershell/module/Microsoft.Graph.Beta.Identity.DirectoryManagement/New-MgBetaDirectorySetting Creates a directory or tenant-level setting using the template ID 62375ab9-6b52-47ed-826b-58e47e0e304b. The example sets values for GuestUsageGuidelinesUrl, EnableMSStandardBlockedWords, EnableMIPLabels, and PrefixSuffixNamingRequirement. Requires GroupSettings.ReadWrite.All or Directory.ReadWrite.All delegated or application permissions. ```powershell Import-Module Microsoft.Graph.Beta.Identity.DirectoryManagement $params = @{ templateId = "62375ab9-6b52-47ed-826b-58e47e0e304b" values = @( @{ name = "GuestUsageGuidelinesUrl" value = "https://privacy.contoso.com/privacystatement" } @{ name = "EnableMSStandardBlockedWords" value = "true" } @{ name = "EnableMIPLabels" value = "true" } @{ name = "PrefixSuffixNamingRequirement" value = "[Contoso-][GroupName]" } ) } New-MgBetaDirectorySetting -BodyParameter $params ``` -------------------------------- ### Example 1: Get all datasources on a gateway cluster Source: https://learn.microsoft.com/en-us/powershell/module/datagateway/get-datagatewayclusterdatasource Retrieves all data sources for the specified gateway cluster using its GUID. ```powershell PS C:\> Get-DataGatewayClusterDatasource -GatewayClusterId DC8F2C49-5731-4B27-966B-3DB5094C2E77 ``` -------------------------------- ### Install-SPHelpCollection -LiteralPath example Source: https://learn.microsoft.com/en-us/powershell/module/sharepointserver/install-sphelpcollection Installs the specified help collection file in the current farm. The example uses the path 'C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\14\HCCab\1033\OSSAdmin.cab'. ```powershell Install-SPHelpCollection -LiteralPath 'C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\14\HCCab\1033\OSSAdmin.cab' ``` -------------------------------- ### Start orchestration on an orchestration group with Invoke-CMOrchestrationGroup Source: https://learn.microsoft.com/en-us/powershell/module/configurationmanager/invoke-cmorchestrationgroup Gets an orchestration group named 'IT servers' and passes it through the pipeline to Invoke-CMOrchestrationGroup, immediately starting the installation and bypassing maintenance windows with -IgnoreServiceWindow $true. ```powershell Get-CMOrchestrationGroup -Name "IT servers" | Invoke-CMOrchestrationGroup -IgnoreServiceWindow $true ``` -------------------------------- ### Install-AzStackHCIRemoteSupport example output Source: https://learn.microsoft.com/en-us/powershell/module/az.stackhci/install-azstackhciremotesupport Output from running Install-AzStackHCIRemoteSupport, showing the RemoteSupportAgent service status and the registry key created. ```text Status Name DisplayName ------ ---- ----------- Stopped RemoteSupportAgent Azure Stack Remote Support Agent Property : {} PSPath : Microsoft.PowerShell.Core\Registry::HKEY_LOCAL_MACHINE\SYSTEM\Software\Microsoft\RemoteSupportAgent PSParentPath : Microsoft.PowerShell.Core\Registry::HKEY_LOCAL_MACHINE\SYSTEM\Software\Microsoft PSChildName : RemoteSupportAgent PSDrive : HKLM PSProvider : Microsoft.PowerShell.Core\Registry PSIsContainer : True SubKeyCount : 0 View : Default Handle : Microsoft.Win32.SafeHandles.SafeRegistryHandle ValueCount : 0 Name : HKEY_LOCAL_MACHINE\SYSTEM\Software\Microsoft\RemoteSupportAgent ``` -------------------------------- ### Create and add Setup Windows and ConfigMgr step to task sequence Source: https://learn.microsoft.com/en-us/powershell/module/configurationmanager/new-cmtsstepsetupwindowsandconfigmgr Creates a Setup Windows and ConfigMgr step with package ID XYZ0002, retrieves a task sequence named 'Default OS deployment', and adds the step at index 11. Use this to insert the step into an existing task sequence. ```powershell $step = New-CMTSStepSetupWindowsAndConfigMgr -Name "Setup Windows and ConfigMgr" -PackageId "XYZ0002" $tsNameOsd = "Default OS deployment" $tsOsd = Get-CMTaskSequence -Name $tsNameOsd -Fast $tsOsd | Add-CMTaskSequenceStep -Step $step -InsertStepStartIndex 11 ``` -------------------------------- ### Example 2: Get trace providers for an ETW session Source: https://learn.microsoft.com/en-us/powershell/module/eventtracingmanagement/get-etwtraceprovider Gets all trace providers for the ETW session named NtfsLog. The output shows two providers with their GUIDs, level, and keyword masks. ```powershell PS C:\> Get-EtwTraceProvider -SessionName "NtfsLog" SessionName : NtfsLog AutologgerName : Guid : {9C88041D-349D-4647-8BFD-2C0A167BFE58} Level : 4 MatchAnyKeyword : 0xFFFFFFFFFFFFFFFF MatchAllKeyword : 0x0 Property : 0 SessionName : NtfsLog AutologgerName : Guid : {5EEFEBDB-E90C-423A-8ABF-0241E7C5B87D} Level : 0 MatchAnyKeyword : 0x0 MatchAllKeyword : 0x0 Property : 0 ``` -------------------------------- ### Get a user discovery method with Get-CMDiscoveryMethod Source: https://learn.microsoft.com/en-us/powershell/module/configurationmanager/get-cmdiscoverymethod Retrieves a Configuration Manager discovery method by name. The example uses the -Name parameter with the value 'ActiveDirectoryUserDiscovery' to get the method that discovers users in the installation. ```powershell PS XYZ:\> Get-CMDiscoveryMethod -Name "ActiveDirectoryUserDiscovery" ``` -------------------------------- ### Example 1: List rack SKUs by subscription Source: https://learn.microsoft.com/en-us/powershell/module/az.networkcloud/get-aznetworkcloudracksku Lists all rack SKUs for a given subscription. The output shows the rack SKU name and system data fields. ```powershell Get-AzNetworkCloudRackSku -SubscriptionId subscriptionId ``` ```text Name SystemDataCreatedAt SystemDataCreatedBy SystemDataCreatedByType SystemDataLastModifiedAt SystemDataLastModifiedBy SystemDataLastModifiedByType ResourceGroupName ---- ------------------- ------------------- ----------------------- ------------------------ ------------------------ ---------------------------- ----------------- rackSkuName 07/10/2023 16:09:59 user1 User 07/10/2023 16:20:31 user2 User resourceGroupName ``` -------------------------------- ### Get-AzSqlInstanceDatabaseLongTermRetentionBackup - Example Output Source: https://learn.microsoft.com/en-us/powershell/module/az.sql/get-azsqlinstancedatabaselongtermretentionbackup Sample output from the example command, showing the properties of the retrieved backup, including BackupExpirationTime, BackupName, BackupTime, DatabaseName, DatabaseDeletionTime, Location, ResourceId, ManagedInstanceName, InstanceCreateTime, and ResourceGroupName. ```text BackupExpirationTime : 3/10/2020 1:10:45 PM BackupName : 15be823c-7e2c-49d8-819f-a3fdcad92215;132268250550000000 BackupTime : 2/22/2020 6:04:15 AM DatabaseName : test DatabaseDeletionTime : 2/24/2020 2:56:44 PM Location : southeastasia ResourceId : /subscriptions/f46521f3-5bb0-4eea-a3c2-c2d5987df96b/resourceGroups/testResourceGroup/providers/Microsoft.Sql/locations/southeastasia/longTermRetentionManaged Instances/testInstance/longTermRetentionDatabases/test/longTermRetentionManagedInstanceBackups/15be823c-7e2c-49d8-819f-a3fdcad92215;132268250550000000 ManagedInstanceName : testInstance InstanceCreateTime : 10/17/2019 4:52:10 PM ResourceGroupName : testResourceGroup ``` -------------------------------- ### Invoke-EntraBetaAgentIdInteractive Source: https://learn.microsoft.com/en-us/powershell/module/microsoft.entra.beta.applications/invoke-entrabetaagentidinteractive Starts the interactive Agent Identity configuration workflow. The cmdlet prompts for all required inputs and guides through the complete setup process. ```APIDOC ## Invoke-EntraBetaAgentIdInteractive ### Description The `Invoke-EntraBetaAgentIdInteractive` cmdlet demonstrates the full workflow of creating and configuring an Agent Identity Blueprint, including creating Agent Identities and Agent Users as needed. It guides you through the complete Agent Identity setup process with prompts at key decision points. ### Syntax ```powershell Invoke-EntraBetaAgentIdInteractive ``` ### Parameters None ### Inputs None ### Outputs None ### Permissions This cmdlet requires the following Microsoft Graph permissions: - Organization.Read.All - AgentIdentityBlueprint.Create - AgentIdentityBlueprintPrincipal.Create - AppRoleAssignment.ReadWrite.All - Application.ReadWrite.All - User.ReadWrite.All The cmdlet will automatically connect to Microsoft Graph with these permissions if not already connected. ### Examples #### Example 1: Start the interactive Agent Identity configuration workflow ```powershell Connect-Entra -Scopes 'Organization.Read.All', 'AgentIdentityBlueprint.Create', 'AgentIdentityBlueprintPrincipal.Create', 'AppRoleAssignment.ReadWrite.All', 'Application.ReadWrite.All', 'User.ReadWrite.All' Invoke-EntraBetaAgentIdInteractive ``` This example starts the interactive Agent Identity configuration workflow. The cmdlet will prompt you for all required inputs and guide you through the complete setup process. ### Notes This cmdlet maintains state between operations, automatically passing Blueprint IDs and other required values to subsequent operations. You can create multiple Agent Identities and Users in a single session. ### Related Links - New-EntraBetaAgentIdentityBlueprint - Add-EntraBetaClientSecretToAgentIdentityBlueprint - New-EntraBetaAgentIdentityBlueprintPrincipal ``` -------------------------------- ### Example 1: Create a RunAs account Source: https://learn.microsoft.com/en-us/powershell/module/system.center.service.manager/new-scrunasaccount Demonstrates creating a RunAs account by building a parameter splat with Get-SCManagementPack, Read-Host for a secure password, and then calling New-SCRunAsAccount. The example also shows verifying the account with Get-SCRunAsAccount. ```powershell PS C:\>$Arguments = @{ >> ManagementPack = Get-SCManagementPack -DisplayName Default* >> Password = Read-Host -AsSecureString "Password" >> UserName = "Administrator" >> Domain = "CONTOSO" >> DisplayName = "Patti Fuller" >> Description = "Patti Fuller" >> } PS C:\>New-SCRunAsAccount @Arguments PS C:\>Get-SCRunAsAccount -DisplayName "Patti Fuller" ``` -------------------------------- ### Example 2: Get a server object by its ID Source: https://learn.microsoft.com/en-us/powershell/module/spfadmin/get-scspfserver Retrieves a server by its GUID using the -ID parameter and stores the result in $Server. ```powershell PS C:\>$Server = Get-SCSPFServer -ID f50e36aa-216f-4ade-a2c0-95cf17b93ee4 ```