### Example 5 Source: https://github.com/microsoftdocs/windows-powershell-docs/blob/main/docset/winserver2025-ps/ServerManager/Install-WindowsFeature.md This example retrieves a list of all Windows features beginning with the characters Web, and then pipes the resulting list to Install-WindowsFeature. The result of this cmdlet is all features that start with Web are installed on the local computer. ```powershell Get-WindowsFeature -Name Web-* | Install-WindowsFeature ``` -------------------------------- ### Example 4: Copy an install image as a multicast transmission with a manual start Source: https://github.com/microsoftdocs/windows-powershell-docs/blob/main/docset/winserver2025-ps/WDS/Copy-WdsInstallImage.md This command copies an install image as a multicast transmission with a manual start. ```powershell Copy-WdsInstallImage -ImageName "Fabrikam Latest with LOB apps" -ImageGroup "Fabrikam Latest Images" -FileName "install-3.wim" -NewImageName "Fabrikam Latest with LOB v2.0 apps" -Multicast -ManualStart -TransmissionName "Fabrikam Latest ScheduledCast with manual start" ``` -------------------------------- ### Example 3:Copy an install image as a multicast transmission with a client count and start time Source: https://github.com/microsoftdocs/windows-powershell-docs/blob/main/docset/winserver2025-ps/WDS/Copy-WdsInstallImage.md Copies an install image as a multicast transmission with a client count and start time. ```powershell Copy-WdsInstallImage -ImageName "Fabrikam Latest with LOB apps" -ImageGroup "Fabrikam Latest Images" -FileName "install-3.wim" -NewImageName "Fabrikam Latest with LOB v2.0 apps" -Multicast -ClientCount 50 -StartTime 2014/12/01:11:00 -TransmissionName "Fabrikam Latest ScheduledCast with automatic start" ``` -------------------------------- ### Example 4: Get a list of Windows features using a search string then pipe the results to Install-WindowsFeatures Source: https://github.com/microsoftdocs/windows-powershell-docs/blob/main/docset/winserver2025-ps/Microsoft.Windows.ServerManager.Migration/Install-WindowsFeature.md This command retrieves a list of all Windows features beginning with the characters Web, and then pipes the resulting list to **Install-WindowsFeature**. The result of this cmdlet is all features that start with Web are installed on the local computer. ```powershell PS C:\> Get-WindowsFeature -Name "Web-*" | Install-WindowsFeature ``` -------------------------------- ### Example 1: Get all InitiatorIDs Source: https://github.com/microsoftdocs/windows-powershell-docs/blob/main/docset/winserver2025-ps/Storage/Get-InitiatorId.md This example gets and displays all iSCSI initiator IDs on the computer. ```PowerShell PS C:\>Get-InitiatorID ``` -------------------------------- ### Example 1: Create a package accelerator Source: https://github.com/microsoftdocs/windows-powershell-docs/blob/main/docset/winserver2025-ps/AppvSequencer/New-AppvPackageAccelerator.md This command creates a package accelerator using an installer folder containing, for example, MSI installers. ```powershell PS C:\> New-AppvPackageAccelerator -AppvPackageFilePath "C:\MyPackages\Package1\Package1.appv" -Installer "C:\MyPackages\Package1" -OutputPath "C:\Output\packages\Package1.cab" ``` -------------------------------- ### Example 2: Get all RAW disks, initialize the disks, partition, and format them Source: https://github.com/microsoftdocs/windows-powershell-docs/blob/main/docset/winserver2025-ps/Storage/New-Partition.md This example uses five cmdlets and the pipeline to get all disks, filter them for only RAW, unpartitioned disks, initialize the disks, partition the disks, and then to format them. ```PowerShell PS C:\> Get-Disk | Where-Object PartitionStyle -Eq "RAW" | Initialize-Disk -PassThru | New-Partition -AssignDriveLetter -UseMaximumSize | Format-Volume ``` -------------------------------- ### Start a BPA scan using the pipeline Source: https://github.com/microsoftdocs/windows-powershell-docs/blob/main/docset/winserver2025-ps/BestPractices/Invoke-BpaModel.md This example gets all BPA models that are installed on the computer, and then pipes the results of the Get-BpaModel cmdlet to this cmdlet to start a BPA scan on all models. ```PowerShell PS C:\> Get-BPAModel | Invoke-BPAModel ``` -------------------------------- ### Example 1: Install IIS, including all role services and applicable management tools on the specified computer Source: https://github.com/microsoftdocs/windows-powershell-docs/blob/main/docset/winserver2025-ps/Microsoft.Windows.ServerManager.Migration/Install-WindowsFeature.md This command installs Web Server (IIS), including all role services and applicable management tools, on a computer named Server1, by using the credentials of a user account named contoso.com\PattiFul. ```powershell PS C:\> Install-WindowsFeature -Name "Web-Server" -IncludeAllSubFeature -IncludeManagementTools -ComputerName "Server1" -Credential "contoso.com\PattiFul" ``` -------------------------------- ### Get a list of available and installed features by command ID Source: https://github.com/microsoftdocs/windows-powershell-docs/blob/main/docset/winserver2025-ps/Microsoft.Windows.ServerManager.Migration/Get-WindowsFeature.md This command gets a list of available and installed features that have a command ID starting with AD or Web. ```PowerShell PS C:\> Get-WindowsFeature -Name "AD*, Web*" ``` -------------------------------- ### Example 2 Source: https://github.com/microsoftdocs/windows-powershell-docs/blob/main/docset/winserver2025-ps/ServerManager/Install-WindowsFeature.md This example installs Web Server (IIS), including all role services and applicable management tools, on a computer named Server1, by using the credentials of a user account named contoso.com\johnj99. ```powershell Install-WindowsFeature -Name Web-Server -IncludeAllSubFeature -IncludeManagementTools -ComputerName Server1 -Credential contoso.com\johnj99 ``` -------------------------------- ### Example 2: Get the storage providers for each InitiatorID Source: https://github.com/microsoftdocs/windows-powershell-docs/blob/main/docset/winserver2025-ps/Storage/Get-InitiatorId.md This example gets and displays the storage providers for each InitiatorID by piping the output from the Get-InitiatorId cmdlet to the Get-StorageSubSystem cmdlet, and then piping that cmdlet's output to the Get-StorageProvider cmdlet. ```PowerShell PS C:\>Get-InitiatorId | Get-StorageSubSystem | Get-StorageProvider ``` -------------------------------- ### Example 5: Modify an install image to start Source: https://github.com/microsoftdocs/windows-powershell-docs/blob/main/docset/winserver2025-ps/WDS/Set-WdsInstallImage.md This command modifies an install image to begin a scheduled transmission. ```PowerShell PS C:\>Set-WdsInstallImage -ImageName "Fabrikam Latest with LOB apps" -ImageGroup "Fabrikam Latest Images" -FileName "install-3.wim" -StartScheduledCast ``` -------------------------------- ### Example 2 Source: https://github.com/microsoftdocs/windows-powershell-docs/blob/main/docset/winserver2025-ps/Hyper-V/Start-VMFailover.md This example starts a test failover of a virtual machine named VM01. ```PowerShell PS C:\> Start-VMFailover VM01 -AsTest ``` -------------------------------- ### Example 3 Source: https://github.com/microsoftdocs/windows-powershell-docs/blob/main/docset/winserver2025-ps/ServerManager/Get-WindowsFeature.md This example returns a list of available and installed features that have a command ID starting with AD or Web. ```powershell Get-WindowsFeature -Name AD*, Web* ``` -------------------------------- ### Example 1 Source: https://github.com/microsoftdocs/windows-powershell-docs/blob/main/docset/winserver2025-ps/ServerManager/Install-WindowsFeature.md This example shows what is installed with Web Server (IIS), including all role services, on a computer named Server1. By adding the WhatIf parameter, you can view the results of the installation command without running it. ```powershell Install-WindowsFeature -Name Web-Server -IncludeAllSubFeature -ComputerName Server1 -WhatIf ``` -------------------------------- ### Example 4: Modify an install image for manual start Source: https://github.com/microsoftdocs/windows-powershell-docs/blob/main/docset/winserver2025-ps/WDS/Set-WdsInstallImage.md This command modifies an install image by using the ManualStart parameter. ```PowerShell PS C:\>Set-WdsInstallImage -ImageName "Fabrikam Latest with LOB apps" -ImageGroup "Fabrikam Latest Images" -FileName "install-3.wim" -Multicast -ManualStart -TransmissionName "Fabrikam Latest ScheduledCast with manual start" ``` -------------------------------- ### Example 1 Source: https://github.com/microsoftdocs/windows-powershell-docs/blob/main/docset/winserver2025-ps/Hyper-V/Start-VMInitialReplication.md This example starts initial replication of virtual machine VM01 over the network. ```PowerShell PS C:\> Start-VMInitialReplication VM01 ``` -------------------------------- ### Example 1 Source: https://github.com/microsoftdocs/windows-powershell-docs/blob/main/docset/winserver2025-ps/Provisioning/Install-ProvisioningPackage.md This will install the mypackage.ppkg file silently without customer interaction. ```PowerShell PS C:\> Install-ProvisioningPackage -PackagePath C:\mypackage.ppkg -QuietInstall ``` -------------------------------- ### Example 1 Source: https://github.com/microsoftdocs/windows-powershell-docs/blob/main/docset/winserver2025-ps/Hyper-V/Get-VMSystemSwitchExtension.md Gets all virtual switch extensions installed on the system. ```PowerShell PS C:\> Get-VMSystemSwitchExtension ``` -------------------------------- ### Example 2: Get the Windows capabilities for the local operating system Source: https://github.com/microsoftdocs/windows-powershell-docs/blob/main/docset/winserver2025-ps/Dism/Get-WindowsCapability.md This command gets the Windows capabilities installed on the local host. ```powershell Get-WindowsCapability -Online ``` -------------------------------- ### Example 2 Source: https://github.com/microsoftdocs/windows-powershell-docs/blob/main/docset/winserver2025-ps/Hyper-V/Start-VMInitialReplication.md This example starts initial replication over the network for all the virtual machines on the local Hyper-V host for which initial replication is pending. ```PowerShell PS C:\> Start-VMInitialReplication * ``` -------------------------------- ### Example 3: Modify start time and client count conditions for an install image Source: https://github.com/microsoftdocs/windows-powershell-docs/blob/main/docset/winserver2025-ps/WDS/Set-WdsInstallImage.md This command modifies an install image by using the ClientCount and StartTime parameters. ```PowerShell PS C:\>Set-WdsInstallImage -ImageName "Fabrikam Latest with LOB apps" -ImageGroup "Fabrikam Latest Images" -FileName "install-3.wim" -Multicast -ClientCount 50 -StartTime 2014/12/01:11:00 -TransmissionName "Fabrikam Latest ScheduledCast with automatic start" ``` -------------------------------- ### StartTime parameter example Source: https://github.com/microsoftdocs/windows-powershell-docs/blob/main/docset/winserver2025-ps/WDS/Copy-WdsInstallImage.md Example of the StartTime parameter's type and attributes. ```yaml Type: DateTime Parameter Sets: SingleImageAutoStart Aliases: Required: False Position: Named Default value: None Accept pipeline input: False Accept wildcard characters: False ``` -------------------------------- ### Example 5 Source: https://github.com/microsoftdocs/windows-powershell-docs/blob/main/docset/winserver2025-ps/Hyper-V/New-VHD.md This example creates a new 127GB VHD and then mounts, initializes, and formats it so the drive is ready to use. ```PowerShell PS C:\> $vhdpath = "C:\VHDs\Test.vhdx" PS C:\> $vhdsize = 127GB PS C:\> New-VHD -Path $vhdpath -Dynamic -SizeBytes $vhdsize | Mount-VHD -Passthru |Initialize-Disk -Passthru |New-Partition -AssignDriveLetter -UseMaximumSize |Format-Volume -FileSystem NTFS -Confirm:$false -Force ``` -------------------------------- ### Get ODBC drivers that begin with a specified string on the 64-bit platform Source: https://github.com/microsoftdocs/windows-powershell-docs/blob/main/docset/winserver2025-ps/Wdac/Get-OdbcDriver.md This command gets installed ODBC drivers that have a name that starts with SQL Server on the 64-bit platform. ```PowerShell PS C:\> Get-OdbcDriver -Name "SQL Server*" -Platform "64-bit" ``` -------------------------------- ### Example 1 Source: https://github.com/microsoftdocs/windows-powershell-docs/blob/main/docset/winserver2025-ps/Hyper-V/Start-VMFailover.md This example starts failover of a virtual machine named VM01 with recovery point Snapshot01. ```PowerShell PS C:\> Get-VMSnapshot VM01 -Name Snapshot01 | Start-VMFailover ``` -------------------------------- ### Get all BPA models Source: https://github.com/microsoftdocs/windows-powershell-docs/blob/main/docset/winserver2025-ps/BestPractices/Get-BpaModel.md This example can be used to return details about BPA scans for all models that are installed on the computer. ```PowerShell PS C:\> Get-BPAModel Id Last Scan Time --- -------------- ModelID1 01/05/2012 10:12 ModelID2 Never ModelID3 05/20/2010 12:46 ``` -------------------------------- ### Example 2: Creating a thinly-provisioned mirror Source: https://github.com/microsoftdocs/windows-powershell-docs/blob/main/docset/winserver2025-ps/Storage/New-VirtualDisk.md This example shows how to create a thinly-provisioned virtual disk with a mirror resiliency setting. ```powershell New-VirtualDisk -StoragePoolFriendlyName CompanyData -FriendlyName DataWarehouse -ResiliencySettingName Mirror -Size 42TB -ProvisioningType Thin ``` -------------------------------- ### Example 1: Get the Windows capabilities for an image Source: https://github.com/microsoftdocs/windows-powershell-docs/blob/main/docset/winserver2025-ps/Dism/Get-WindowsCapability.md This command gets the Windows capabilities installed in the operating system image specified by the *Name* parameter at the path C:\offline. ```powershell Get-WindowsCapability -Path "C:\offline" -Name "Language.TextToSpeech~~~fr-FR~0.0.1.0" ``` -------------------------------- ### Example 2 Source: https://github.com/microsoftdocs/windows-powershell-docs/blob/main/docset/winserver2025-ps/Hyper-V/Get-VMResourcePool.md Get all resource pools on the local virtual machine host having a name that starts with Test. ```PowerShell PS C:\> Get-VMResourcePool Test* ``` -------------------------------- ### Example 1: Creating a 100 GB virtual disk using default settings Source: https://github.com/microsoftdocs/windows-powershell-docs/blob/main/docset/winserver2025-ps/Storage/New-VirtualDisk.md This example demonstrates how to create a 100GB virtual disk with default settings. ```powershell PS C:\> New-VirtualDisk -StoragePoolFriendlyName CompanyData -FriendlyName UserData -Size 100GB ``` -------------------------------- ### Example 3 Source: https://github.com/microsoftdocs/windows-powershell-docs/blob/main/docset/winserver2025-ps/Hyper-V/Start-VMFailover.md Starts a test failover of a virtual machine named VM01 with recovery point Snapshot01. ```PowerShell PS C:\> Get-VMSnapshot VM01 -Name Snapshot01 | Start-VMFailover -AsTest ``` -------------------------------- ### Example 1 Source: https://github.com/microsoftdocs/windows-powershell-docs/blob/main/docset/winserver2025-ps/ServerManager/Get-WindowsFeature.md This example gets a list of features that are available and installed on the target computer named Server1. The credentials for user1 in the Contoso.com domain, a user who has Administrator rights on Server1, are provided. ```powershell Get-WindowsFeature -ComputerName Server1 -Credential contoso.com\user1 ``` -------------------------------- ### Example 1 Source: https://github.com/microsoftdocs/windows-powershell-docs/blob/main/docset/winserver2025-ps/Hyper-V/Set-VMFirmware.md This example enables secure boot functionality on the virtual machine "Test VM". ```PowerShell PS C:\> Set-VMFirmware "Test VM" -EnableSecureBoot On ``` -------------------------------- ### Example 7: Get the advanced properties for network adapters with a search string for the display name Source: https://github.com/microsoftdocs/windows-powershell-docs/blob/main/docset/winserver2025-ps/NetAdapter/Get-NetAdapterAdvancedProperty.md This command gets the advanced properties for network adapters that have a display name that starts with TCP. ```PowerShell PS C:\> Get-NetAdapterAdvancedProperty -Name "*" | Where-Object -FilterScript { $_.DisplayName -Like "TCP*" } ``` -------------------------------- ### Example 1: Start publishing refresh Source: https://github.com/microsoftdocs/windows-powershell-docs/blob/main/docset/winserver2025-ps/AppvClient/Sync-AppvPublishingServer.md This command starts publishing refresh for the current user for the server named MyServer. ```PowerShell PS C:\> Sync-AppvPublishingServer -Name "MyServer" ``` -------------------------------- ### Example 5: Get a network adapter by the specified name Source: https://github.com/microsoftdocs/windows-powershell-docs/blob/main/docset/winserver2025-ps/NetAdapter/Get-NetAdapter.md This command gets adapters starting with "E" and ending in "2" using wildcard characters. ```powershell PS C:\> Get-NetAdapter -Name "E*2" ``` -------------------------------- ### Example 2: Create a network controller in a domain joined environment Source: https://github.com/microsoftdocs/windows-powershell-docs/blob/main/docset/winserver2025-ps/NetworkController/Install-NetworkController.md This example creates a network controller in a domain-joined environment. It first creates network controller node objects, then retrieves a certificate, and finally installs the network controller cluster and the network controller itself. ```PowerShell PS C:\> $Node01 = New-NetworkControllerNodeObject -Name "Node01" -Server "NCNode01.Contoso.com" -FaultDomain "fd:/rack1/host1" -RestInterface Ethernet PS C:\> $Node02 = New-NetworkControllerNodeObject -Name "Node02" -Server "NCNode02.Contoso.com" -FaultDomain "fd:/rack1/host2" -RestInterface Ethernet PS C:\> $Node03 = New-NetworkControllerNodeObject -Name "Node03" -Server "NCNode03.Contoso.com" -FaultDomain "fd:/rack2/host3" -RestInterface Ethernet PS C:\> $Certificate = Get-Item Cert:\LocalMachine\My | Get-ChildItem | where {$_.Subject -imatch "NCEncryption" } PS C:\> Install-NetworkControllerCluster -Node @($Node01,$Node02,$Node03) -ClusterAuthentication Kerberos -ManagementSecurityGroup "Contoso\NCManagementAdmins" -LogLocation "\\share\diagnostics" -CredentialEncryptionCertificate $Certificate PS C:\> Install-NetworkController -Node @($Node01,$Node02,$Node03) -ClientAuthentication Kerberos -ClientSecurityGroup "Contoso\RestClients" -RestIpAddress "10.0.0.1/24" -StoreCertificate $Certificate -EnableAllLogs Node : {Node01, Node02, Node03} ClientAuthentication : Kerberos ClientCertificateThumbprint : ClientSecurityGroup : Contoso\RestClients ServerCertificate : [Subject] CN=NCEncryption [Issuer] CN=Contoso [Serial Number] 1C00000003786A607D6EFB733F000000000003 [Not Before] 2/11/2015 6:18:21 AM [Not After] 2/10/2017 6:18:21 AM [Thumbprint] D4FDE4F607849083C590466334D66037C0E38001 RestIPAddress : 10.0.0.1/24 Version : 10.0.0 ``` -------------------------------- ### Example 1 Source: https://github.com/microsoftdocs/windows-powershell-docs/blob/main/docset/winserver2025-ps/FailoverClusters/Start-ClusterResource.md This example brings the resource called `IP Address 172.24.11.0` online on the local cluster. Before bringing the resource online, this cmdlet brings online any resources on which the resource depends. ```powershell Start-ClusterResource -Name "IP Address 172.24.11.0" ``` -------------------------------- ### Get file information for all packaged applications for all users Source: https://github.com/microsoftdocs/windows-powershell-docs/blob/main/docset/winserver2025-ps/AppLocker/Get-AppLockerFileInformation.md This example outputs the file information for all the packaged applications installed on this computer for all users. ```PowerShell PS C:\> Get-AppXPackage -AllUsers | Get-AppLockerFileInformation Path : windows.immersivecontrolpanel_6.2.0.0_neutral_neutral_cw5n1h2txyewy.appx Publisher : CN=Microsoft Windows, O=Microsoft Corporation, L=Redmond, S=Washington, C=US\windows.immersivecontrolpanel\APPX,6.2.0.0 Hash : AppX : True Path : windows.RemoteDesktop_1.0.0.0_neutral_neutral_cw5n1h2txyewy.appx Publisher : CN=Microsoft Windows, O=Microsoft Corporation, L=Redmond, S=Washington, C=US\windows.RemoteDesktop\APPX,1.0.0.0 Hash : AppX : True Path : WinStore_1.0.0.0_neutral_neutral_cw5n1h2txyewy.appx Publisher : CN=Microsoft Windows, O=Microsoft Corporation, L=Redmond, S=Washington, C=US\WinStore\APPX,1.0.0.0 Hash : AppX : True ``` -------------------------------- ### Example 2: Get the list of all teams whose name starts with T and then remove Source: https://github.com/microsoftdocs/windows-powershell-docs/blob/main/docset/winserver2025-ps/NetLbfo/Get-NetLbfoTeam.md This command retrieves the list of teams whose name starts with T using Get-NetLbfoTeam. A pipeline operator (|) sends all the teams to Remove-NetLbfoTeam, which removes them. ```powershell PS C:\> Get-NetLbfoTeam -Name T*| Remove-NetLbfoTeam ``` -------------------------------- ### Example 4 Source: https://github.com/microsoftdocs/windows-powershell-docs/blob/main/docset/winserver2025-ps/Hyper-V/Start-VMInitialReplication.md This example uses several consecutive commands to start initial replication from backup. First, it enables a restored copy of virtual machine VM01 on the Replica server as a Replica virtual machine. Then, it enables replication for VM01 from the primary server. Finally, it starts the initial replication to use the restored copy of VM01 on Replica server as the basis of the initial replication. ```PowerShell PS C:\> Enable-VMReplication VM01 -AsReplica -computername MyReplica.contoso.com PS C:\> Enable-VMReplication VMO1 -ReplicaServerName ReplicaServer01 -ReplicaServerPort 80 -AuthenticationType Kerberos -computername MyPrimary.contoso.comPS PS C:\> Start-VMInitialReplication VM01 -usebackup -computername MyPrimary.contoso.com ``` -------------------------------- ### Example 6: Provision GPO and output the objects Source: https://github.com/microsoftdocs/windows-powershell-docs/blob/main/docset/winserver2025-ps/IpamServer/Invoke-IpamGpoProvisioning.md This example shows how to provision GPOs and output the resulting objects. ```PowerShell PS C:\> Invoke-IpamGpoProvisioning -Domain "Ds2-infra.Contoso.com" -GpoPrefixName "IPAM1" -PassThru -Force DisplayName : IPAM1_DNS DomainName : ds2-infra.contoso.com Owner : DS2-INFRA\Domain Admins Id : ac9dcf5e-8581-442d-ba12-ae7569985313 GpoStatus : AllSettingsEnabled Description : CreationTime : 2/7/2012 1:04:18 AM ModificationTime : 2/7/2012 1:04:28 AM UserVersion : AD Version: 1, SysVol Version: 1 ComputerVersion : AD Version: 1, SysVol Version: 1 WmiFilter : DisplayName : IPAM1_DC_NPS DomainName : ds2-infra.contoso.com Owner : DS2-INFRA\Domain Admins Id : 5aaf16d7-9818-47c4-ade9-3860bc00c292 GpoStatus : AllSettingsEnabled Description : CreationTime : 2/7/2012 1:04:19 AM ModificationTime : 2/7/2012 1:04:28 AM UserVersion : AD Version: 1, SysVol Version: 1 ComputerVersion : AD Version: 1, SysVol Version: 1 WmiFilter : DisplayName : IPAM1_DHCP DomainName : ds2-infra.contoso.com Owner : DS2-INFRA\Domain Admins Id : 51fb3dee-0032-4d9a-8b92-84af318dcb51 GpoStatus : AllSettingsEnabled Description : CreationTime : 2/7/2012 1:04:20 AM ModificationTime : 2/7/2012 1:04:28 AM UserVersion : AD Version: 1, SysVol Version: 1 ComputerVersion : AD Version: 1, SysVol Version: 1 WmiFilter : ``` -------------------------------- ### Example 1 Source: https://github.com/microsoftdocs/windows-powershell-docs/blob/main/docset/winserver2025-ps/Hyper-V/Get-VMSystemSwitchExtensionPortFeature.md Gets all port-level features, supported by various virtual switch extensions installed on the system, that can be configured on a virtual network adapter on Hyper-V. ```PowerShell PS C:\> Get-VMSystemSwitchExtensionPortFeature ``` -------------------------------- ### Example 4: Get information on claims using a LDAP based query filter Source: https://github.com/microsoftdocs/windows-powershell-docs/blob/main/docset/winserver2025-ps/ActiveDirectory/Get-ADClaimTransformPolicy.md This command gets information on any claims transformation policies using an LDAP-based query filter that looks for matches where policies have a name that starts with the word DenyAll. ```powershell Get-ADClaimTransformPolicy -LDAPFilter "(name=DenyAll*)" ``` -------------------------------- ### Example 2 Source: https://github.com/microsoftdocs/windows-powershell-docs/blob/main/docset/winserver2025-ps/Hyper-V/Add-VMGpuPartitionAdapter.md This example assigns a partition from a specific GPU to a VM where the instance path is the GPU device ID name on the host. ```powershell $vm = Get-VM -Name "TestVM" Add-VMGpuPartitionAdapter -VM $vm -InstancePath "GPUInstancePath" ``` -------------------------------- ### Example 3 Source: https://github.com/microsoftdocs/windows-powershell-docs/blob/main/docset/winserver2025-ps/Hyper-V/Start-VMInitialReplication.md This example exports the initial replication of all virtual machines on the local Hyper-V host for which initial replication is pending, to the location R:\IRLoc. This example assumes that the location is an external drive, which would be shipped to the Replica site so that the initial replication can be completed. ```PowerShell PS C:\> Start-VMInitialReplication * -DestinationPath R:\IRLoc ``` -------------------------------- ### Example 2: Get a detailed list of updating runs from a date span from the specified cluster Source: https://github.com/microsoftdocs/windows-powershell-docs/blob/main/docset/winserver2025-ps/ClusterAwareUpdating/Get-CauReport.md This command gets a detailed list of the updating runs performed on the cluster called Contoso-FC1 starting with updating runs on 01/01/2012 and ending with updating runs on 04/01/2012. ```powershell Get-CauReport -ClusterName "Contoso-FC1" -StartDate 01/01/2012 -EndDate 04/01/2012 -Detailed ``` -------------------------------- ### Get all installed ODBC drivers Source: https://github.com/microsoftdocs/windows-powershell-docs/blob/main/docset/winserver2025-ps/Wdac/Get-OdbcDriver.md This command gets all installed ODBC drivers. The cmdlet gets both 32-bit and 64-bit drivers. ```PowerShell PS C:\> Get-OdbcDriver ``` -------------------------------- ### Example 1 Source: https://github.com/microsoftdocs/windows-powershell-docs/blob/main/docset/winserver2025-ps/Provisioning/Get-ProvisioningPackage.md This command gets information about the testppkg.ppkg provisioning package. ```PowerShell PS C:\> Get-ProvisioningPackage -PackagePath c:\test\testppkg.ppkg ``` -------------------------------- ### Example 2 Source: https://github.com/microsoftdocs/windows-powershell-docs/blob/main/docset/winserver2025-ps/FailoverClusters/Start-ClusterResource.md This example brings the resource called `IP Address 172.24.11.0` online on the local cluster. Before bringing the resource online, this cmdlet brings online any resources on which the resource depends. The Windows PowerShell prompt returns as soon as the action has been initiated. ```powershell Start-ClusterResource -Name "IP Address 172.24.11.0" -Wait 0 ``` -------------------------------- ### Example 1: Get all target portals Source: https://github.com/microsoftdocs/windows-powershell-docs/blob/main/docset/winserver2025-ps/Storage/Get-TargetPortal.md This example gets all target portals. ```PowerShell Get-TargetPortal ``` -------------------------------- ### Example 1: Add an app package Source: https://github.com/microsoftdocs/windows-powershell-docs/blob/main/docset/winserver2025-ps/Appx/Add-AppxPackage.md This example adds an app package to the local computer. ```PowerShell Add-AppxPackage -Path "C:\Users\Public\Documents\MyPackage.msix" ``` -------------------------------- ### Get a feature by its GUID Source: https://github.com/microsoftdocs/windows-powershell-docs/blob/main/docset/winserver2025-ps/ActiveDirectory/Get-ADOptionalFeature.md This command gets the optional feature with the feature GUID 766ddcd8-acd0-445e-f3b9-a7f9b6744f2a. ```PowerShell PS C:\> Get-ADOptionalFeature -Identity 766ddcd8-acd0-445e-f3b9-a7f9b6744f2a ``` -------------------------------- ### Example 2: Install all role services and applicable management tools from a configuration file to the default computer Source: https://github.com/microsoftdocs/windows-powershell-docs/blob/main/docset/winserver2025-ps/Microsoft.Windows.ServerManager.Migration/Install-WindowsFeature.md This command installs all roles, role services and features that are specified in a configuration file named ADCSConfigFile.xml. ```powershell PS C:\> Install-WindowsFeature -ConfigurationFilePath "d:\ConfigurationFiles\ADCSConfigFile.xml" ``` -------------------------------- ### Example 3: Test if installation of domain controller is possible using Administrator credentials Source: https://github.com/microsoftdocs/windows-powershell-docs/blob/main/docset/winserver2025-ps/ADDSDeployment/Test-ADDSDomainControllerInstallation.md This command runs the prerequisites to determine if installing a domain controller along with a DNS server is possible. It prompts for Administrator credentials and checks domain name validity and DSRM password setup. ```powershell $HashArguments = @{ Credential = (Get-Credential) DomainName = (Read-Host "Domain to promote into") InstallDns = $true } Test-ADDSDomainControllerInstallation @HashArguments ``` -------------------------------- ### Example 4: Download and publish a new package Source: https://github.com/microsoftdocs/windows-powershell-docs/blob/main/docset/winserver2025-ps/AppvClient/Mount-AppvClientPackage.md This command adds the package from the path specified, downloads it, and then publishes it to all users on the computer. ```powershell PS C:\> Add-AppvClientPackage -Path "http://MyServer/content/package.Appv" | Mount-AppvClientPackage | Publish-AppvClientPackage -Global ``` -------------------------------- ### Get all IP address audit events for an end date and a start date Source: https://github.com/microsoftdocs/windows-powershell-docs/blob/main/docset/winserver2025-ps/IpamServer/Get-IpamIpAddressAuditEvent.md This example retrieves IP address audit events for a specific IP address within a specified date range. ```PowerShell PS C:\> $Today = Get-Date PS C:\> $LastMonth = $Today.AddDays(-30) PS C:\> $IpamIpAddressAuditEvents = Get-IpamIpAddressAuditEvent -StartDate $LastMonth -EndDate $Today -IpAddress 10.10.1.1 ``` -------------------------------- ### Example 1: Enable manual entry point selection Source: https://github.com/microsoftdocs/windows-powershell-docs/blob/main/docset/winserver2025-ps/RemoteAccess/Set-DAMultiSite.md This example enables users to manually select entry points when using the Windows Server 2012 Network connectivity assistant. ```powershell PS C:\>Set-DAMultiSite -ManualEntryPointSelection enabled -PassTrue EnterpriseName : Company Enterprise GslbFqdn : ManualEntryPointSelectionAllowed : Enabled DAEntryPoints : Entry Point 1 ``` -------------------------------- ### Example 4 Source: https://github.com/microsoftdocs/windows-powershell-docs/blob/main/docset/winserver2025-ps/Hyper-V/Start-VMFailover.md This example shows the cmdlets you use to perform a planned failover. The first command prepares for the planned failover of a primary virtual machine named VM01 by replicating any pending changes. The second command fails over the Replica virtual machine. The third command switches the Replica virtual machine to a primary virtual machine. The fourth command starts the virtual machine that has been switched from a Replica virtual machine to a primary virtual machine. ```PowerShell PS C:\> Start-VMFailover -Prepare -VMName VM01 -computername MyPrimary.contoso.com PS C:\> Start-VMFailover -VMName VM01 -computername MyReplica.contoso.com PS C:\> Set-VMReplication -Reverse -VMName VM01 -computername MyReplica.contoso.com PS C:\> Start-VM -VMName VM01 -computername MyReplica.contoso.com ``` -------------------------------- ### Example 3: Get all unhealthy storage subsystems Source: https://github.com/microsoftdocs/windows-powershell-docs/blob/main/docset/winserver2025-ps/Storage/Get-StorageSubSystem.md This example gets all storage subsystems in an unhealthy state. ```PowerShell PS C:\>Get-StorageSubSystem -HealthStatus Unhealthy ``` -------------------------------- ### Example 7: Get all overlapping ranges Source: https://github.com/microsoftdocs/windows-powershell-docs/blob/main/docset/winserver2025-ps/IpamServer/Get-IpamRange.md This command gets all overlapping ranges from the default address space. Both Provider and NonVirtualized ranges can exist in the default address space. In IPAM, IP ranges are marked overlapping if they belong to same address space and their start and end IP addresses overlap. ```PowerShell Get-IpamRange -AddressFamily IPv4 -AddressCategory Private -AddressSpace "Default" | where {$Overlapping -eq $True} ``` -------------------------------- ### Get an install image group Source: https://github.com/microsoftdocs/windows-powershell-docs/blob/main/docset/winserver2025-ps/WDS/Get-WdsInstallImageGroup.md This command gets the install image group named Fabrikam LOB Images. ```PowerShell PS C:\> Get-WdsInstallImageGroup -Name "Fabrikam LOB Images" ``` -------------------------------- ### Example 2: Get summary statistics for past connections. Source: https://github.com/microsoftdocs/windows-powershell-docs/blob/main/docset/winserver2025-ps/RemoteAccess/Get-RemoteAccessConnectionStatisticsSummary.md This example gets the summary statistics for past connections. ```PowerShell PS C:\>$startdate = Get-Date -Date "12/25/2011" PS C:\>$enddate = Get-Date -Date "01/10/2012" When the start date or end date are specified, this cmdlet retrieves the counters from accounting store. PS C:\>Get-RemoteAccessConnectionStatisticsSummary -StartDateTime $startdate -EndDateTime $enddate TotalSessions : 2314 TotalDASessions : 2314 TotalVpnSessions : 0 MaxConcurrentSessions : 28 TotalUniqueDAClients : 27 AverageSessionsPerDay : 144 TotalUniqueUsers : 57 ``` -------------------------------- ### Example 1: Get all RSS capable network adapters Source: https://github.com/microsoftdocs/windows-powershell-docs/blob/main/docset/winserver2025-ps/NetAdapter/Get-NetAdapterRss.md This example gets all RSS capable network adapters. ```PowerShell Get-NetAdapterRss -Name "*" ``` -------------------------------- ### Start-VM Source: https://github.com/microsoftdocs/windows-powershell-docs/blob/main/docset/winserver2025-ps/Hyper-V/Start-VM.md Starts virtual machine TestVM. ```PowerShell PS C:\> Start-VM -Name TestVM ``` -------------------------------- ### Example 2: Create a package accelerator with instruction sheet Source: https://github.com/microsoftdocs/windows-powershell-docs/blob/main/docset/winserver2025-ps/AppvSequencer/New-AppvPackageAccelerator.md This command creates a package accelerator and inserts an instruction sheet on how to accelerate package. ```powershell PS C:\> New-AppvPackageAccelerator -AppvPackageFilePath "C:\MyPackages\Package1\Package1.appv" -InstalledFilesPath "C:\Program Files\Package1InstallFolder" -OutputPath "C:\Output\packages\Package1.cab" -AcceleratorDescriptionFilePath "C:\MyPackages\Package1\Package1Description.rtf" ```