From e5717dff6490584e2fc22edffe1b176c5bd9a1fd Mon Sep 17 00:00:00 2001 From: Xelu86 <103963494+Xelu86@users.noreply.github.com> Date: Wed, 26 Jul 2023 12:20:42 -0400 Subject: [PATCH] Updated command set --- .../winserver2022-ps/hyper-v/Convert-VHD.md | 124 ++++++---- .../winserver2022-ps/hyper-v/Dismount-VHD.md | 97 +++++--- docset/winserver2022-ps/hyper-v/Get-VHD.md | 101 +++++--- docset/winserver2022-ps/hyper-v/Merge-VHD.md | 106 ++++++--- docset/winserver2022-ps/hyper-v/Mount-VHD.md | 115 +++++---- docset/winserver2022-ps/hyper-v/New-VHD.md | 221 ++++++++++++------ .../winserver2022-ps/hyper-v/Optimize-VHD.md | 146 ++++++++---- docset/winserver2022-ps/hyper-v/Resize-VHD.md | 120 ++++++---- docset/winserver2022-ps/hyper-v/Set-VHD.md | 164 ++++++++----- docset/winserver2022-ps/hyper-v/Test-VHD.md | 72 ++++-- 10 files changed, 838 insertions(+), 428 deletions(-) diff --git a/docset/winserver2022-ps/hyper-v/Convert-VHD.md b/docset/winserver2022-ps/hyper-v/Convert-VHD.md index fc8bc05e9c..f724be6193 100644 --- a/docset/winserver2022-ps/hyper-v/Convert-VHD.md +++ b/docset/winserver2022-ps/hyper-v/Convert-VHD.md @@ -2,7 +2,7 @@ description: Use this topic to help manage Windows and Windows Server technologies with Windows PowerShell. external help file: Microsoft.HyperV.PowerShell.Cmdlets.dll-Help.xml Module Name: Hyper-V -ms.date: 12/20/2016 +ms.date: 06/21/2023 online version: https://learn.microsoft.com/powershell/module/hyper-v/convert-vhd?view=windowsserver2022-ps&wt.mc_id=ps-gethelp schema: 2.0.0 title: Convert-VHD @@ -17,41 +17,55 @@ Converts the format, version type, and block size of a virtual hard disk file. ``` Convert-VHD [-Path] [-DestinationPath] [-VHDType ] [-ParentPath ] - [-BlockSizeBytes ] [-DeleteSource] [-AsJob] [-Passthru] [-CimSession ] + [-BlockSizeBytes ] [-DeleteSource] [-AsJob] [-PassThru] + [-AddressAbstractionType ] [-CimSession ] [-ComputerName ] [-Credential ] [-WhatIf] [-Confirm] [] ``` ## DESCRIPTION -The **Convert-VHD** cmdlet converts a virtual hard disk file by copying the data from a source virtual hard disk file to a new virtual hard disk file of a specified format and version type. -The format is determined by the file name extension of the specified files, either .vhdx or .vhd. -Conversion is an offline operation; the virtual hard disk must not be attached when the operation is started. + +The `Convert-VHD` cmdlet converts a virtual hard disk file by copying the data from a source virtual +hard disk file to a new virtual hard disk file of a specified format and version type. The format is +determined by the file name extension of the specified files, either vhdx or vhd. Conversion is an +offline operation; the virtual hard disk must not be attached when the operation is started. ## EXAMPLES ### Example 1 -``` -PS C:\> Convert-VHD -Path c:\test\testvhd.vhd -DestinationPath c:\test\testvhdx.vhdx + +```powershell +Convert-VHD -Path c:\test\testvhd.vhd -DestinationPath c:\test\testvhdx.vhdx ``` -This example converts a source VHD to a destination VHDX. -Because the format is determined by the file name extension and the default type is determined by the source virtual hard disk when no type is specified, the destination virtual hard disk will be a VHDX-format disk of the same type as the source virtual hard disk. +This example converts a source VHD to a destination VHDX. Because the format is determined by the +file name extension and the default type is determined by the source virtual hard disk when no type +is specified, the destination virtual hard disk will be a VHDX-format disk of the same type as the +source virtual hard disk. ### Example 2 -``` -PS C:\> Convert-VHD -Path c:\test\child1vhdx.vhdx -DestinationPath c:\test\child1vhd.vhd -VHDType Differencing -ParentPath c:\test\parentvhd.vhd + +```powershell +$parameters = @{ +DestinationPath = "C:\test\child1vhd.vhd" +VHDType = "Differencing" +ParentPath = "C:\test\parentvhd.vhd" +} +Convert-VHD -Path c:\test\child1vhdx.vhdx @parameters ``` -This example converts a source differencing disk of VHDX format to a destination differencing disk of VHD format that is connected to an existing parent disk. +This example converts a source differencing disk of VHDX format to a destination differencing disk +of VHD format that's connected to an existing parent disk. ## PARAMETERS ### -AsJob + Runs the cmdlet as a background job. ```yaml Type: SwitchParameter Parameter Sets: (All) -Aliases: +Aliases: Required: False Position: Named @@ -61,12 +75,13 @@ Accept wildcard characters: False ``` ### -BlockSizeBytes + Specifies the block size, in bytes, of the virtual hard disk after conversion. ```yaml Type: UInt32 Parameter Sets: (All) -Aliases: +Aliases: Required: False Position: Named @@ -76,14 +91,16 @@ Accept wildcard characters: False ``` ### -CimSession -Runs the cmdlet in a remote session or on a remote computer. -Enter a computer name or a session object, such as the output of a [New-CimSession](https://go.microsoft.com/fwlink/p/?LinkId=227967) or [Get-CimSession](https://go.microsoft.com/fwlink/p/?LinkId=227966) cmdlet. -The default is the current session on the local computer. + +Runs the cmdlet in a remote session or on a remote computer. Enter a computer name or a session +object, such as the output of a [New-CimSession](https://go.microsoft.com/fwlink/p/?LinkId=227967) +or [Get-CimSession](https://go.microsoft.com/fwlink/p/?LinkId=227966) cmdlet. The default is the +current session on the local computer. ```yaml Type: CimSession[] Parameter Sets: (All) -Aliases: +Aliases: Required: False Position: Named @@ -93,15 +110,15 @@ Accept wildcard characters: False ``` ### -ComputerName -Specifies one or more Hyper-V hosts on which the virtual hard disk is to be converted. -NetBIOS names, IP addresses, and fully qualified domain names are allowable. -The default is the local computer. -Use localhost or a dot (.) to specify the local computer explicitly. + +Specifies one or more Hyper-V hosts on which the virtual hard disk is to be converted. NetBIOS +names, IP addresses, and fully qualified domain names are allowable. The default is the local +computer. Use localhost or a dot (.) to specify the local computer explicitly. ```yaml Type: String[] Parameter Sets: (All) -Aliases: +Aliases: Required: False Position: Named @@ -111,6 +128,7 @@ Accept wildcard characters: False ``` ### -Confirm + Prompts you for confirmation before running the cmdlet. ```yaml @@ -126,13 +144,14 @@ Accept wildcard characters: False ``` ### -Credential -Specifies one or more user accounts that have permission to perform this action. -The default is the current user. + +Specifies one or more user accounts that have permission to perform this action. The default is the +current user. ```yaml Type: PSCredential[] Parameter Sets: (All) -Aliases: +Aliases: Required: False Position: Named @@ -142,12 +161,13 @@ Accept wildcard characters: False ``` ### -DeleteSource + Specifies that the source virtual hard disk is to be deleted after the conversion. ```yaml Type: SwitchParameter Parameter Sets: (All) -Aliases: +Aliases: Required: False Position: Named @@ -157,12 +177,13 @@ Accept wildcard characters: False ``` ### -DestinationPath + Specifies the path to the converted virtual hard disk file. ```yaml Type: String Parameter Sets: (All) -Aliases: +Aliases: Required: True Position: 1 @@ -172,12 +193,13 @@ Accept wildcard characters: False ``` ### -ParentPath + Specifies the parent path for the destination-differencing virtual hard disk file. ```yaml Type: String Parameter Sets: (All) -Aliases: +Aliases: Required: False Position: Named @@ -186,13 +208,15 @@ Accept pipeline input: False Accept wildcard characters: False ``` -### -Passthru -Specifies that an object is to be passed through to the pipeline representing the converted virtual hard disk. +### -PassThru + +Specifies that an object is to be passed through to the pipeline representing the converted virtual +hard disk. ```yaml Type: SwitchParameter Parameter Sets: (All) -Aliases: +Aliases: Required: False Position: Named @@ -202,8 +226,10 @@ Accept wildcard characters: False ``` ### -Path -Specifies the path to the virtual hard disk file to be converted. -If a file name or relative path is specified, the path of the converted hard disk path is calculated relative to the current working directory + +Specifies the path to the virtual hard disk file to be converted. If a file name or relative path is +specified, the path of the converted hard disk path is calculated relative to the current working +directory ```yaml Type: String @@ -218,14 +244,14 @@ Accept wildcard characters: False ``` ### -VHDType -Specifies the type of the converted virtual hard disk. -Allowed values are **Fixed**, **Dynamic**, and **Differencing**. -The default is determined by the type of source virtual hard disk. + +Specifies the type of the converted virtual hard disk. Allowed values are **Fixed**, **Dynamic**, +and **Differencing**. The default is determined by the type of source virtual hard disk. ```yaml Type: VhdType Parameter Sets: (All) -Aliases: +Aliases: Accepted values: Unknown, Fixed, Dynamic, Differencing Required: False @@ -236,8 +262,8 @@ Accept wildcard characters: False ``` ### -WhatIf -Shows what would happen if the cmdlet runs. -The cmdlet is not run. + +Shows what would happen if the cmdlet runs. The cmdlet isn't run. ```yaml Type: SwitchParameter @@ -246,16 +272,22 @@ Aliases: wi Required: False Position: Named -Default value: False +Default value: None Accept pipeline input: False Accept wildcard characters: False ``` ### CommonParameters -This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](https://go.microsoft.com/fwlink/?LinkID=113216). + +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, +-InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, +-WarningAction, and -WarningVariable. For more information, see +[about_CommonParameters](https://go.microsoft.com/fwlink/?LinkID=113216). ## INPUTS +### System.String + ## OUTPUTS ### Microsoft.Vhd.PowerShell.VirtualHardDisk @@ -264,3 +296,11 @@ This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable ## RELATED LINKS +- [Get-VHD](get-vhd.md) +- [Merge-VHD](merge-vhd.md) +- [Mount-VHD](mount-vhd.md) +- [New-VHD](new-vhd.md) +- [Optimize-VHD](optimize-vhd.md) +- [Resize-VHD](resize-vhd.md) +- [Set-VHD](set-vhd.md) +- [Test-VHD](test-vhd.md) diff --git a/docset/winserver2022-ps/hyper-v/Dismount-VHD.md b/docset/winserver2022-ps/hyper-v/Dismount-VHD.md index c55044fcde..fa19c5086a 100644 --- a/docset/winserver2022-ps/hyper-v/Dismount-VHD.md +++ b/docset/winserver2022-ps/hyper-v/Dismount-VHD.md @@ -2,7 +2,7 @@ description: Use this topic to help manage Windows and Windows Server technologies with Windows PowerShell. external help file: Microsoft.HyperV.PowerShell.Cmdlets.dll-Help.xml Module Name: Hyper-V -ms.date: 12/20/2016 +ms.date: 06/21/2023 online version: https://learn.microsoft.com/powershell/module/hyper-v/dismount-vhd?view=windowsserver2022-ps&wt.mc_id=ps-gethelp schema: 2.0.0 title: Dismount-VHD @@ -16,32 +16,38 @@ Dismounts a virtual hard disk. ## SYNTAX ### Path (Default) + ``` -Dismount-VHD [-Path] [-SnapshotId ] [-Passthru] [-CimSession ] +Dismount-VHD [-Path] [-SnapshotId ] [-PassThru] [-CimSession ] [-ComputerName ] [-Credential ] [-WhatIf] [-Confirm] [] ``` ### Disk + ``` -Dismount-VHD [-DiskNumber] [-Passthru] [-CimSession ] [-ComputerName ] - [-Credential ] [-WhatIf] [-Confirm] [] +Dismount-VHD [-DiskNumber] [-PassThru] [-CimSession ] + [-ComputerName ] [-Credential ] [-WhatIf] [-Confirm] [] ``` ## DESCRIPTION -The **Dismount-VHD** cmdlet dismounts a virtual hard disk. + +The `Dismount-VHD` cmdlet dismounts a virtual hard disk. ## EXAMPLES ### Example 1 -``` -PS C:\> Dismount-VHD -Path c:\test\testvhdx.vhdx + +```powershell +Dismount-VHD -Path C:\test\testvhdx.vhdx ``` -Dismounts an attached virtual hard disk where the path to the virtual hard disk file path is c:\test\testvhdx.vhdx. +Dismounts an attached virtual hard disk where the path to the virtual hard disk file path is +`C:\test\testvhdx.vhdx`. ### Example 2 -``` -PS C:\> Dismount-VHD -DiskNumber 6 + +```powershell +Dismount-VHD -DiskNumber 6 ``` Dismounts the attached virtual hard disk image with disk number 6. @@ -49,14 +55,16 @@ Dismounts the attached virtual hard disk image with disk number 6. ## PARAMETERS ### -CimSession -Runs the cmdlet in a remote session or on a remote computer. -Enter a computer name or a session object, such as the output of a [New-CimSession](https://go.microsoft.com/fwlink/p/?LinkId=227967) or [Get-CimSession](https://go.microsoft.com/fwlink/p/?LinkId=227966) cmdlet. -The default is the current session on the local computer. + +Runs the cmdlet in a remote session or on a remote computer. Enter a computer name or a session +object, such as the output of a [New-CimSession](https://go.microsoft.com/fwlink/p/?LinkId=227967) +or [Get-CimSession](https://go.microsoft.com/fwlink/p/?LinkId=227966) cmdlet. The default is the +current session on the local computer. ```yaml Type: CimSession[] Parameter Sets: (All) -Aliases: +Aliases: Required: False Position: Named @@ -66,15 +74,15 @@ Accept wildcard characters: False ``` ### -ComputerName -Specifies one or more Hyper-V hosts on which a virtual hard disk is to be dismounted. -NetBIOS names, IP addresses, and fully qualified domain names are allowable. -The default is the local computer. -Use localhost or a dot (.) to specify the local computer explicitly. + +Specifies one or more Hyper-V hosts on which a virtual hard disk is to be dismounted. NetBIOS names, +IP addresses, and fully qualified domain names are allowable. The default is the local computer. Use +localhost or a dot (.) to specify the local computer explicitly. ```yaml Type: String[] Parameter Sets: (All) -Aliases: +Aliases: Required: False Position: Named @@ -84,6 +92,7 @@ Accept wildcard characters: False ``` ### -Confirm + Prompts you for confirmation before running the cmdlet. ```yaml @@ -99,13 +108,14 @@ Accept wildcard characters: False ``` ### -Credential -Specifies one or more user accounts that have permission to perform this action. -The default is the current user. + +Specifies one or more user accounts that have permission to perform this action. The default is the +current user. ```yaml Type: PSCredential[] Parameter Sets: (All) -Aliases: +Aliases: Required: False Position: Named @@ -115,6 +125,7 @@ Accept wildcard characters: False ``` ### -DiskNumber + Specifies the disk number of the virtual hard disk to be dismounted. ```yaml @@ -129,13 +140,15 @@ Accept pipeline input: True (ByPropertyName) Accept wildcard characters: False ``` -### -Passthru -Specifies that an object is to be passed through to the pipeline representing the virtual hard disk to be dismounted. +### -PassThru + +Specifies that an object is to be passed through to the pipeline representing the virtual hard disk +to be dismounted. ```yaml Type: SwitchParameter Parameter Sets: (All) -Aliases: +Aliases: Required: False Position: Named @@ -145,7 +158,9 @@ Accept wildcard characters: False ``` ### -Path -Specifies one or more virtual hard disk files for which the corresponding virtual hard disks are to be dismounted. + +Specifies one or more virtual hard disk files for which the corresponding virtual hard disks are to +be dismounted. ```yaml Type: String[] @@ -160,12 +175,13 @@ Accept wildcard characters: False ``` ### -SnapshotId + Specifies the unique ID of a VHD set snapshot. ```yaml Type: Guid Parameter Sets: Path -Aliases: +Aliases: Required: False Position: Named @@ -175,8 +191,8 @@ Accept wildcard characters: False ``` ### -WhatIf -Shows what would happen if the cmdlet runs. -The cmdlet is not run. + +Shows what would happen if the cmdlet runs. The cmdlet isn't run. ```yaml Type: SwitchParameter @@ -185,16 +201,26 @@ Aliases: wi Required: False Position: Named -Default value: False +Default value: None Accept pipeline input: False Accept wildcard characters: False ``` ### CommonParameters -This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](https://go.microsoft.com/fwlink/?LinkID=113216). + +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, +-InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, +-WarningAction, and -WarningVariable. For more information, see +[about_CommonParameters](https://go.microsoft.com/fwlink/?LinkID=113216). ## INPUTS +### System.UInt32 + +### System.String[] + +### System.Nullable`1[[System.Guid, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]] + ## OUTPUTS ### Microsoft.Vhd.PowerShell.VirtualHardDisk @@ -203,3 +229,12 @@ This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable ## RELATED LINKS +- [Convert-VHD](convert-vhd.md) +- [Get-VHD](get-vhd.md) +- [Merge-VHD](merge-vhd.md) +- [Mount-VHD](mount-vhd.md) +- [New-VHD](new-vhd.md) +- [Optimize-VHD](optimize-vhd.md) +- [Resize-VHD](resize-vhd.md) +- [Set-VHD](set-vhd.md) +- [Test-VHD](test-vhd.md) diff --git a/docset/winserver2022-ps/hyper-v/Get-VHD.md b/docset/winserver2022-ps/hyper-v/Get-VHD.md index 6e0991324d..dab3df59b4 100644 --- a/docset/winserver2022-ps/hyper-v/Get-VHD.md +++ b/docset/winserver2022-ps/hyper-v/Get-VHD.md @@ -2,7 +2,7 @@ description: Use this topic to help manage Windows and Windows Server technologies with Windows PowerShell. external help file: Microsoft.HyperV.PowerShell.Cmdlets.dll-Help.xml Module Name: Hyper-V -ms.date: 12/20/2016 +ms.date: 06/21/2023 online version: https://learn.microsoft.com/powershell/module/hyper-v/get-vhd?view=windowsserver2022-ps&wt.mc_id=ps-gethelp schema: 2.0.0 title: Get-VHD @@ -16,77 +16,93 @@ Gets the virtual hard disk object associated with a virtual hard disk. ## SYNTAX ### Path (Default) + ``` Get-VHD [-Path] [-CimSession ] [-ComputerName ] [-Credential ] [] ``` ### Disk + ``` Get-VHD [-DiskNumber] [-CimSession ] [-ComputerName ] [-Credential ] [] ``` ### VMId + ``` -Get-VHD [-VMId] [-CimSession ] [-ComputerName ] [-Credential ] - [] +Get-VHD [-VMId] [-CimSession ] [-ComputerName ] + [-Credential ] [] ``` ## DESCRIPTION -The **Get-VHD** cmdlet gets the virtual hard disk object associated with a virtual hard disk. -> [!Note] -> When the VHD is in use (for example by a VM or mounted in the OS) and it is on shared storage, the **Get-VHD** cmdlet can only access it from the host that is using it. Any other server trying to run the **Get-VHD** cmdlet will get an error that it is in use. +The `Get-VHD` cmdlet gets the virtual hard disk object associated with a virtual hard disk. + +> [!NOTE] +> When the VHD is in use (for example by a VM or mounted in the OS) and it's on shared +storage, the `Get-VHD` cmdlet can only access it from the host that's using it. Any other server +trying to run the `Get-VHD` cmdlet will get an error that it's in use. ## EXAMPLES ### Example 1 + ```powershell -PS C:\> Get-VHD -Path C:\test\testvhdx.vhdx +Get-VHD -Path C:\test\testvhdx.vhdx ``` Gets the virtual hard disk where the path to the virtual hard disk file is `C:\test\testvhdx.vhdx`. ### Example 2 + ```powershell -PS C:\> Get-VHD -DiskNumber 6 +Get-VHD -DiskNumber 6 ``` Gets the virtual hard disk attached to the system with disk number 6. ### Example 3 + ```powershell -PS C:\> Get-VM -VMName TestVM | Select-Object -Property VMId | Get-VHD +Get-VM -VMName TestVM | Select-Object -Property VMId | Get-VHD ``` -Gets the virtual hard disk objects associated with virtual machine TestVM, using the pipeline feature for the VMId parameter. +Gets the virtual hard disk objects associated with virtual machine TestVM, using the pipeline +feature for the **VMId** parameter. ### Example 4 + ```powershell -PS C:\> Get-VM -VMName TestVM | Select-Object -Property VMId | Get-VHD +Get-VM -VMName TestVM | Select-Object -Property VMId | Get-VHD ``` -Gets the virtual hard disk objects associated with virtual machine TestVM using the pipeline feature for the path parameter. +Gets the virtual hard disk objects associated with virtual machine TestVM using the pipeline feature +for the path parameter. ### Example 5 + ```powershell -PS C:\> Get-ChildItem -Path C:\test -Recurse -Include *.vhd, *.vhdx, *.vhds, *.avhd, *.avhdx | Get-VHD +Get-ChildItem -Path C:\test -Recurse -Include *.vhd, *.vhdx, *.vhds, *.avhd, *.avhdx | Get-VHD ``` -Gets the virtual hard disk object for all the virtual hard disk files that are contained in the specified directory and its subdirectories. +Gets the virtual hard disk object for all the virtual hard disk files that are contained in the +specified directory and its subdirectories. ## PARAMETERS ### -CimSession -Runs the cmdlet in a remote session or on a remote computer. -Enter a computer name or a session object, such as the output of a [New-CimSession](https://go.microsoft.com/fwlink/p/?LinkId=227967) or [Get-CimSession](https://go.microsoft.com/fwlink/p/?LinkId=227966) cmdlet. -The default is the current session on the local computer. + +Runs the cmdlet in a remote session or on a remote computer. Enter a computer name or a session +object, such as the output of a [New-CimSession](https://go.microsoft.com/fwlink/p/?LinkId=227967) +or [Get-CimSession](https://go.microsoft.com/fwlink/p/?LinkId=227966) cmdlet. The default is the +current session on the local computer. ```yaml Type: CimSession[] Parameter Sets: (All) -Aliases: +Aliases: Required: False Position: Named @@ -96,15 +112,15 @@ Accept wildcard characters: False ``` ### -ComputerName -Specifies one or more Hyper-V hosts on which a virtual hard disk is to be retrieved. -NetBIOS names, IP addresses, and fully qualified domain names are allowable. -The default is the local computer. -Use localhost or a dot (.) to specify the local computer explicitly. + +Specifies one or more Hyper-V hosts on which a virtual hard disk is to be retrieved. NetBIOS names, +IP addresses, and fully qualified domain names are allowable. The default is the local computer. Use +localhost or a dot (.) to specify the local computer explicitly. ```yaml Type: String[] Parameter Sets: (All) -Aliases: +Aliases: Required: False Position: Named @@ -114,13 +130,14 @@ Accept wildcard characters: False ``` ### -Credential -Specifies one or more user accounts that have permission to perform this action. -The default is the current user. + +Specifies one or more user accounts that have permission to perform this action. The default is the +current user. ```yaml Type: PSCredential[] Parameter Sets: (All) -Aliases: +Aliases: Required: False Position: Named @@ -130,6 +147,7 @@ Accept wildcard characters: False ``` ### -DiskNumber + Specifies the disk number associated with the virtual hard disk to be retrieved. ```yaml @@ -145,8 +163,10 @@ Accept wildcard characters: False ``` ### -Path -Specifies the path to the virtual hard disk file of the virtual hard disk to be retrieved. -If a filename or relative path is specified, the path is calculated relative to the current working directory. + +Specifies the path to the virtual hard disk file of the virtual hard disk to be retrieved. If a +filename or relative path is specified, the path is calculated relative to the current working +directory. ```yaml Type: String[] @@ -161,7 +181,9 @@ Accept wildcard characters: False ``` ### -VMId -Specifies the virtual machine identifier of the virtual machine whose virtual hard disks are to be retrieved. + +Specifies the virtual machine identifier of the virtual machine whose virtual hard disks are to be +retrieved. ```yaml Type: Guid[] @@ -176,10 +198,20 @@ Accept wildcard characters: False ``` ### CommonParameters -This cmdlet supports the common parameters: `-Debug`, `-ErrorAction`, `-ErrorVariable`, `-InformationAction`, `-InformationVariable`, `-OutVariable`, `-OutBuffer`, `-PipelineVariable`, `-Verbose`, `-WarningAction`, and `-WarningVariable`. For more information, see [about_CommonParameters](https://go.microsoft.com/fwlink/?LinkID=113216) + +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, +-InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, +-WarningAction, and -WarningVariable. For more information, see +[about_CommonParameters](https://go.microsoft.com/fwlink/?LinkID=113216). ## INPUTS +### System.UInt32 + +### System.String[] + +### System.Guid[] + ## OUTPUTS ### Microsoft.Vhd.PowerShell.VirtualHardDisk @@ -188,3 +220,12 @@ This cmdlet supports the common parameters: `-Debug`, `-ErrorAction`, `-ErrorVar ## RELATED LINKS +- [Convert-VHD](convert-vhd.md) +- [Dismount-VHD](dismount-vhd.md) +- [Merge-VHD](merge-vhd.md) +- [Mount-VHD](mount-vhd.md) +- [New-VHD](new-vhd.md) +- [Optimize-VHD](optimize-vhd.md) +- [Resize-VHD](resize-vhd.md) +- [Set-VHD](set-vhd.md) +- [Test-VHD](test-vhd.md) diff --git a/docset/winserver2022-ps/hyper-v/Merge-VHD.md b/docset/winserver2022-ps/hyper-v/Merge-VHD.md index 45e3d3d8cf..fa2ab601cb 100644 --- a/docset/winserver2022-ps/hyper-v/Merge-VHD.md +++ b/docset/winserver2022-ps/hyper-v/Merge-VHD.md @@ -2,7 +2,7 @@ description: Use this topic to help manage Windows and Windows Server technologies with Windows PowerShell. external help file: Microsoft.HyperV.PowerShell.Cmdlets.dll-Help.xml Module Name: Hyper-V -ms.date: 12/20/2016 +ms.date: 06/21/2023 online version: https://learn.microsoft.com/powershell/module/hyper-v/merge-vhd?view=windowsserver2022-ps&wt.mc_id=ps-gethelp schema: 2.0.0 title: Merge-VHD @@ -16,37 +16,43 @@ Merges virtual hard disks. ## SYNTAX ``` -Merge-VHD [-Path] [[-DestinationPath] ] [-Force] [-AsJob] [-Passthru] - [-CimSession ] [-ComputerName ] [-Credential ] [-WhatIf] [-Confirm] - [] +Merge-VHD [-Path] [[-DestinationPath] ] [-Force] [-AsJob] [-PassThru] + [-CimSession ] [-ComputerName ] [-Credential ] [-WhatIf] + [-Confirm] [] ``` ## DESCRIPTION -The **Merge-VHD** cmdlet merges virtual hard disks in a differencing virtual hard disk chain. -The merge is from a specified source child disk to a specified destination child disk. -Merge is an offline operation; the virtual hard disk chain must not be attached when merge is initiated. +The `Merge-VHD` cmdlet merges virtual hard disks in a differencing virtual hard disk chain. The +merge is from a specified source child disk to a specified destination child disk. + +Merge is an offline operation; the virtual hard disk chain must not be attached when merge is +initiated. ## EXAMPLES ### Example 1 -``` -PS C:\> Merge-VHD -Path c:\test\Child4.vhdx -DestinationPath c:\test\Child2.vhdx + +```powershell +Merge-VHD -Path C:\test\Child4.vhdx -DestinationPath C:\test\Child2.vhdx ``` -This example merges the virtual hard disk from Child4 to Child2, for a virtual disk chain with Child4 as a child of Child3, Child3 as a child of Child2, Child2 as a child of Child1, and Child1 as a child of Parent, and with the virtual hard disk file for each located in c:\test. -This example merges all data from Child4 and Child3 up to Child2. -Child4.vhdx and Child3.vhdx are not deleted, but are no longer valid virtual hard disk files after the operation. +This example merges the virtual hard disk from Child4 to Child2, for a virtual disk chain with +Child4 as a child of Child3, Child3 as a child of Child2, Child2 as a child of Child1, and Child1 as +a child of Parent, and with the virtual hard disk file for each located in `C:\test`. This example +merges all data from Child4 and Child3 up to Child2. **Child4.vhdx** and **Child3.vhdx** aren't +deleted, but are no longer valid virtual hard disk files after the operation. ## PARAMETERS ### -AsJob + Runs the cmdlet as a background job. ```yaml Type: SwitchParameter Parameter Sets: (All) -Aliases: +Aliases: Required: False Position: Named @@ -56,14 +62,16 @@ Accept wildcard characters: False ``` ### -CimSession -Runs the cmdlet in a remote session or on a remote computer. -Enter a computer name or a session object, such as the output of a [New-CimSession](https://go.microsoft.com/fwlink/p/?LinkId=227967) or [Get-CimSession](https://go.microsoft.com/fwlink/p/?LinkId=227966) cmdlet. -The default is the current session on the local computer. + +Runs the cmdlet in a remote session or on a remote computer. Enter a computer name or a session +object, such as the output of a [New-CimSession](https://go.microsoft.com/fwlink/p/?LinkId=227967) +or [Get-CimSession](https://go.microsoft.com/fwlink/p/?LinkId=227966) cmdlet. The default is the +current session on the local computer. ```yaml Type: CimSession[] Parameter Sets: (All) -Aliases: +Aliases: Required: False Position: Named @@ -73,15 +81,15 @@ Accept wildcard characters: False ``` ### -ComputerName -Specifies one or more Hyper-V hosts on which virtual hard disks are to be merged. -NetBIOS names, IP addresses, and fully qualified domain names are allowable. -The default is the local computer. -Use localhost or a dot (.) to specify the local computer explicitly. + +Specifies one or more Hyper-V hosts on which virtual hard disks are to be merged. NetBIOS names, IP +addresses, and fully qualified domain names are allowable. The default is the local computer. Use +localhost or a dot (.) to specify the local computer explicitly. ```yaml Type: String[] Parameter Sets: (All) -Aliases: +Aliases: Required: False Position: Named @@ -91,6 +99,7 @@ Accept wildcard characters: False ``` ### -Confirm + Prompts you for confirmation before running the cmdlet. ```yaml @@ -106,13 +115,14 @@ Accept wildcard characters: False ``` ### -Credential -Specifies one or more user accounts that have permission to perform this action. -The default is the current user. + +Specifies one or more user accounts that have permission to perform this action. The default is the +current user. ```yaml Type: PSCredential[] Parameter Sets: (All) -Aliases: +Aliases: Required: False Position: Named @@ -122,12 +132,14 @@ Accept wildcard characters: False ``` ### -DestinationPath -Specifies the path to the child in the virtual hard disk chain that is the destination for the merge command. + +Specifies the path to the child in the virtual hard disk chain that's the destination for the merge +command. ```yaml Type: String Parameter Sets: (All) -Aliases: +Aliases: Required: False Position: 1 @@ -137,12 +149,13 @@ Accept wildcard characters: False ``` ### -Force + Runs the cmdlet without prompting for confirmation. ```yaml Type: SwitchParameter Parameter Sets: (All) -Aliases: +Aliases: Required: False Position: Named @@ -151,13 +164,15 @@ Accept pipeline input: False Accept wildcard characters: False ``` -### -Passthru -Specifies that an object is to be passed through to the pipeline representing the merged virtual hard disk. +### -PassThru + +Specifies that an object is to be passed through to the pipeline representing the merged virtual +hard disk. ```yaml Type: SwitchParameter Parameter Sets: (All) -Aliases: +Aliases: Required: False Position: Named @@ -167,8 +182,10 @@ Accept wildcard characters: False ``` ### -Path -Specifies the path to the child in the virtual hard disk chain that is the source for the merge command. -If a filename or relative path is specified, the virtual hard disk path will be calculated relative to the current working directory. + +Specifies the path to the child in the virtual hard disk chain that's the source for the merge +command. If a filename or relative path is specified, the virtual hard disk path will be calculated +relative to the current working directory. ```yaml Type: String @@ -183,8 +200,8 @@ Accept wildcard characters: False ``` ### -WhatIf -Shows what would happen if the cmdlet runs. -The cmdlet is not run. + +Shows what would happen if the cmdlet runs. The cmdlet isn't run. ```yaml Type: SwitchParameter @@ -193,17 +210,21 @@ Aliases: wi Required: False Position: Named -Default value: False +Default value: None Accept pipeline input: False Accept wildcard characters: False ``` ### CommonParameters -This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](https://go.microsoft.com/fwlink/?LinkID=113216). + +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, +-InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, +-WarningAction, and -WarningVariable. For more information, see +[about_CommonParameters](https://go.microsoft.com/fwlink/?LinkID=113216). ## INPUTS -### VHDObject +### System.String ## OUTPUTS @@ -213,3 +234,12 @@ This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable ## RELATED LINKS +- [Convert-VHD](convert-vhd.md) +- [Dismount-VHD](dismount-vhd.md) +- [Get-VHD](get-vhd.md) +- [Mount-VHD](mount-vhd.md) +- [New-VHD](new-vhd.md) +- [Optimize-VHD](optimize-vhd.md) +- [Resize-VHD](resize-vhd.md) +- [Set-VHD](set-vhd.md) +- [Test-VHD](test-vhd.md) diff --git a/docset/winserver2022-ps/hyper-v/Mount-VHD.md b/docset/winserver2022-ps/hyper-v/Mount-VHD.md index 43c1d6eb99..cebb0a29fb 100644 --- a/docset/winserver2022-ps/hyper-v/Mount-VHD.md +++ b/docset/winserver2022-ps/hyper-v/Mount-VHD.md @@ -2,7 +2,7 @@ description: Use this topic to help manage Windows and Windows Server technologies with Windows PowerShell. external help file: Microsoft.HyperV.PowerShell.Cmdlets.dll-Help.xml Module Name: Hyper-V -ms.date: 12/20/2016 +ms.date: 06/21/2023 online version: https://learn.microsoft.com/powershell/module/hyper-v/mount-vhd?view=windowsserver2022-ps&wt.mc_id=ps-gethelp schema: 2.0.0 title: Mount-VHD @@ -16,48 +16,56 @@ Mounts one or more virtual hard disks. ## SYNTAX ``` -Mount-VHD [-Path] [-NoDriveLetter] [-ReadOnly] [-SnapshotId ] [-Passthru] - [-CimSession ] [-ComputerName ] [-Credential ] [-WhatIf] [-Confirm] - [] +Mount-VHD [-Path] [-NoDriveLetter] [-ReadOnly] [-SnapshotId ] [-PassThru] + [-CimSession ] [-ComputerName ] [-Credential ] [-WhatIf] + [-Confirm] [] ``` ## DESCRIPTION -The **Mount-VHD** cmdlet mounts one or more virtual hard disks. + +The `Mount-VHD` cmdlet mounts one or more virtual hard disks. ## EXAMPLES ### Example 1 -``` -PS C:\> Mount-VHD -Path c:\test\testvhdx.vhdx + +```powershell +Mount-VHD -Path C:\test\testvhdx.vhdx ``` -Mounts a virtual hard disk where the path to the virtual hard disk file is c:\test\testvhdx.vhdx. +Mounts a virtual hard disk where the path to the virtual hard disk file is `C:\test\testvhdx.vhdx`. ### Example 2 -``` -PS C:\> Mount-VHD -Path c:\test\testvhdx.vhdx -ReadOnly + +```powershell +Mount-VHD -Path C:\test\testvhdx.vhdx -ReadOnly ``` -Mounts a virtual hard disk in read-only mode where the path to the virtual hard disk file is c:\test\testvhdx.vhdx. +Mounts a virtual hard disk in read-only mode where the path to the virtual hard disk file is +`C:\test\testvhdx.vhdx`. ### Example 3 -``` -PS C:\> Mount-VHD -Path c:\test\testvhdx -PassThru | Get-Disk | Get-Partition | Get-Volume + +```powershell +Mount-VHD -Path C:\test\testvhdx -PassThru | Get-Disk | Get-Partition | Get-Volume ``` -Attaches a virtual hard disk to the system where the path to the virtual hard disk file is c:\test\testvhdx.vhdx, and gets the volumes associated with it. +Attaches a virtual hard disk to the system where the path to the virtual hard disk file is +`C:\test\testvhdx.vhdx`, and gets the volumes associated with it. ## PARAMETERS ### -CimSession -Runs the cmdlet in a remote session or on a remote computer. -Enter a computer name or a session object, such as the output of a [New-CimSession](https://go.microsoft.com/fwlink/p/?LinkId=227967) or [Get-CimSession](https://go.microsoft.com/fwlink/p/?LinkId=227966) cmdlet. -The default is the current session on the local computer. + +Runs the cmdlet in a remote session or on a remote computer. Enter a computer name or a session +object, such as the output of a [New-CimSession](https://go.microsoft.com/fwlink/p/?LinkId=227967) +or [Get-CimSession](https://go.microsoft.com/fwlink/p/?LinkId=227966) cmdlet. The default is the +current session on the local computer. ```yaml Type: CimSession[] Parameter Sets: (All) -Aliases: +Aliases: Required: False Position: Named @@ -67,15 +75,15 @@ Accept wildcard characters: False ``` ### -ComputerName -Specifies one or more Hyper-V hosts on which a virtual hard disk is to be mounted. -NetBIOS names, IP addresses, and fully qualified domain names are allowable. -The default is the local computer. -Use localhost or a dot (.) to specify the local computer explicitly. + +Specifies one or more Hyper-V hosts on which a virtual hard disk is to be mounted. NetBIOS names, IP +addresses, and fully qualified domain names are allowable. The default is the local computer. Use +localhost or a dot (.) to specify the local computer explicitly. ```yaml Type: String[] Parameter Sets: (All) -Aliases: +Aliases: Required: False Position: Named @@ -85,6 +93,7 @@ Accept wildcard characters: False ``` ### -Confirm + Prompts you for confirmation before running the cmdlet. ```yaml @@ -100,13 +109,14 @@ Accept wildcard characters: False ``` ### -Credential -Specifies one or more user accounts that have permission to perform this action. -The default is the current user. + +Specifies one or more user accounts that have permission to perform this action. The default is the +current user. ```yaml Type: PSCredential[] Parameter Sets: (All) -Aliases: +Aliases: Required: False Position: Named @@ -116,12 +126,14 @@ Accept wildcard characters: False ``` ### -NoDriveLetter -Specifies that the virtual hard disk is to be mounted without assigning drive letters to the volumes contained within the virtual hard disk. + +Specifies that the virtual hard disk is to be mounted without assigning drive letters to the volumes +contained within the virtual hard disk. ```yaml Type: SwitchParameter Parameter Sets: (All) -Aliases: +Aliases: Required: False Position: Named @@ -130,13 +142,15 @@ Accept pipeline input: False Accept wildcard characters: False ``` -### -Passthru -Specifies that an object is to be passed through to the pipeline representing the virtual hard disk to be mounted. +### -PassThru + +Specifies that an object is to be passed through to the pipeline representing the virtual hard disk +to be mounted. ```yaml Type: SwitchParameter Parameter Sets: (All) -Aliases: +Aliases: Required: False Position: Named @@ -146,8 +160,10 @@ Accept wildcard characters: False ``` ### -Path -Specifies the path to the virtual hard disk file for the virtual hard disk to be mounted. -If a filename or relative path is specified, the virtual hard disk path is calculated relative to the current working directory. + +Specifies the path to the virtual hard disk file for the virtual hard disk to be mounted. If a +filename or relative path is specified, the virtual hard disk path is calculated relative to the +current working directory. ```yaml Type: String[] @@ -162,12 +178,13 @@ Accept wildcard characters: False ``` ### -ReadOnly + Specifies that the virtual hard disk is to be mounted in read-only mode. ```yaml Type: SwitchParameter Parameter Sets: (All) -Aliases: +Aliases: Required: False Position: Named @@ -177,12 +194,13 @@ Accept wildcard characters: False ``` ### -SnapshotId + Specifies the unique ID of a VHD set. ```yaml Type: Guid Parameter Sets: (All) -Aliases: +Aliases: Required: False Position: Named @@ -192,8 +210,8 @@ Accept wildcard characters: False ``` ### -WhatIf -Shows what would happen if the cmdlet runs. -The cmdlet is not run. + +Shows what would happen if the cmdlet runs. The cmdlet isn't run. ```yaml Type: SwitchParameter @@ -202,16 +220,24 @@ Aliases: wi Required: False Position: Named -Default value: False +Default value: None Accept pipeline input: False Accept wildcard characters: False ``` ### CommonParameters -This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](https://go.microsoft.com/fwlink/?LinkID=113216). + +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, +-InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, +-WarningAction, and -WarningVariable. For more information, see +[about_CommonParameters](https://go.microsoft.com/fwlink/?LinkID=113216). ## INPUTS +### System.String[] + +### System.Nullable`1[[System.Guid, mscorlib, Version=4.0.0.0, Culture=neutral,PublicKeyToken=b77a5c561934e089]] + ## OUTPUTS ### Microsoft.Vhd.PowerShell.VirtualHardDisk @@ -219,4 +245,13 @@ This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable ## NOTES ## RELATED LINKS -[Mount-DiskImage](/powershell/module/storage/mount-diskimage) + +- [Convert-VHD](convert-vhd.md) +- [Dismount-VHD](dismount-vhd.md) +- [Get-VHD](get-vhd.md) +- [Merge-VHD](merge-vhd.md) +- [New-VHD](new-vhd.md) +- [Optimize-VHD](optimize-vhd.md) +- [Resize-VHD](resize-vhd.md) +- [Set-VHD](set-vhd.md) +- [Test-VHD](test-vhd.md) diff --git a/docset/winserver2022-ps/hyper-v/New-VHD.md b/docset/winserver2022-ps/hyper-v/New-VHD.md index 3fa9f4ebed..1b471cbcda 100644 --- a/docset/winserver2022-ps/hyper-v/New-VHD.md +++ b/docset/winserver2022-ps/hyper-v/New-VHD.md @@ -2,7 +2,7 @@ description: Use this topic to help manage Windows and Windows Server technologies with Windows PowerShell. external help file: Microsoft.HyperV.PowerShell.Cmdlets.dll-Help.xml Module Name: Hyper-V -ms.date: 12/20/2016 +ms.date: 06/21/2023 online version: https://learn.microsoft.com/powershell/module/hyper-v/new-vhd?view=windowsserver2022-ps&wt.mc_id=ps-gethelp schema: 2.0.0 title: New-VHD @@ -16,95 +16,121 @@ Creates one or more new virtual hard disks. ## SYNTAX ### DynamicWithoutSource (Default) + ``` New-VHD [-Path] [-SizeBytes] [-Dynamic] [-BlockSizeBytes ] - [-LogicalSectorSizeBytes ] [-PhysicalSectorSizeBytes ] [-AsJob] [-CimSession ] - [-ComputerName ] [-Credential ] [-WhatIf] [-Confirm] [] + [-LogicalSectorSizeBytes ] [-PhysicalSectorSizeBytes ] [-AsJob] + [-CimSession ] [-ComputerName ] [-Credential ] [-WhatIf] + [-Confirm] [] +``` + +### DynamicWithSource + +``` +New-VHD [-Path] -SourceDisk [-Dynamic] [-BlockSizeBytes ] [-AsJob] + [-CimSession ] [-ComputerName ] [-Credential ] [-WhatIf] + [-Confirm] [] ``` ### Differencing + ``` New-VHD [-Path] [-ParentPath] [[-SizeBytes] ] [-Differencing] - [-BlockSizeBytes ] [-PhysicalSectorSizeBytes ] [-AsJob] [-CimSession ] - [-ComputerName ] [-Credential ] [-WhatIf] [-Confirm] [] + [-BlockSizeBytes ] [-PhysicalSectorSizeBytes ] [-AsJob] + [-CimSession ] [-ComputerName ] [-Credential ] [-WhatIf] + [-Confirm] [] ``` ### FixedWithoutSource + ``` New-VHD [-Path] [-SizeBytes] [-Fixed] [-BlockSizeBytes ] - [-LogicalSectorSizeBytes ] [-PhysicalSectorSizeBytes ] [-AsJob] [-CimSession ] - [-ComputerName ] [-Credential ] [-WhatIf] [-Confirm] [] + [-LogicalSectorSizeBytes ] [-PhysicalSectorSizeBytes ] + [-AddressAbstractionType ] + [-DataAlignmentBytes ] [-AsJob] [-CimSession ] [-ComputerName ] + [-Credential ] [-WhatIf] [-Confirm] [] ``` ### FixedWithSource -``` -New-VHD [-Path] -SourceDisk [-Fixed] [-BlockSizeBytes ] [-AsJob] - [-CimSession ] [-ComputerName ] [-Credential ] [-WhatIf] [-Confirm] - [] -``` -### DynamicWithSource ``` -New-VHD [-Path] -SourceDisk [-Dynamic] [-BlockSizeBytes ] [-AsJob] - [-CimSession ] [-ComputerName ] [-Credential ] [-WhatIf] [-Confirm] - [] +New-VHD [-Path] -SourceDisk [-Fixed] [-BlockSizeBytes ] [-AsJob] + [-CimSession ] [-ComputerName ] [-Credential ] [-WhatIf] + [-Confirm] [] ``` ## DESCRIPTION -The **New-VHD** cmdlet creates one or more new virtual hard disks in either VHD format or the newer VHDX format. -The file name extension you specify determines the format. + +The `New-VHD` cmdlet creates one or more new virtual hard disks in either VHD format or the newer +VHDX format. The file name extension you specify determines the format. ## EXAMPLES ### Example 1 -``` -PS C:\> New-VHD -Path c:\Base.vhdx -SizeBytes 10GB + +```powershell +New-VHD -Path C:\Base.vhdx -SizeBytes 10GB ``` -This example creates a dynamic virtual hard disk in VHDX format that is 10 GB in size. -The file name extension determines the format and the default type of dynamic is used because no type is specified. +This example creates a dynamic virtual hard disk in VHDX format that's 10 GB in size. The file name +extension determines the format and the default type of dynamic is used because no type is +specified. ### Example 2 -``` -PS C:\> New-VHD -ParentPath c:\Base.vhdx -Path c:\Diff.vhdx -Differencing + +```powershell +New-VHD -ParentPath C:\Base.vhdx -Path C:\Diff.vhdx -Differencing ``` -This example creates a VHDX-format differencing virtual hard disk with a parent path of c:\Base.vhdx. +This example creates a VHDX-format differencing virtual hard disk with a parent path of +`C:\Base.vhdx`. ### Example 3 -``` -PS C:\> New-VHD -Path C:\fixed.vhd -Fixed -SourceDisk 2 -SizeBytes 1TB + +```powershell +New-VHD -Path C:\Fixed.vhd -Fixed -SourceDisk 2 -SizeBytes 1TB ``` -This example creates a 1 TB VHD-format fixed virtual hard disk at the specified path. -The data for the virtual hard disk is populated from the disk identified in the system by the number 2. -You can list the disks attached to the system and the number associated with each disk using the **Get-Disk** cmdlet. +This example creates a 1 TB VHD-format fixed virtual hard disk at the specified path. The data for +the virtual hard disk is populated from the disk identified in the system by the number 2. You can +list the disks attached to the system and the number associated with each disk using the `Get-Disk` +cmdlet. ### Example 4 -``` -PS C:\> New-VHD -Path c:\LargeSectorBlockSize.vhdx -BlockSizeBytes 128MB -LogicalSectorSize 4KB -SizeBytes 1TB + +```powershell +$parameters = @{ +BlockSizeBytes = "128MB" +LogicalSectorSize = "4KB" +SizeBytes = "1TB" +} +New-VHD -Path C:\LargeSectorBlockSize.vhdx @parameters ``` -This example creates a new 1 TB VHDX-format dynamic virtual hard disk at the specified path with a block size of 128 MB and a logical sector size of 4 KB. +This example creates a new 1 TB VHDX-format dynamic virtual hard disk at the specified path with a +block size of 128 MB and a logical sector size of 4 KB. ### Example 5 -``` -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 + +```powershell +$vhdpath = "C:\VHDs\Test.vhdx" +$vhdsize = 127GB +New-VHD -Path $vhdpath -Dynamic -SizeBytes $vhdsize | Mount-VHD -PassThru | Initialize-Disk -PassThru | New-Partition -AssignDriveLetter -UseMaximumSize | Format-Volume -FileSystem NTFS -Confirm $false -Force ``` -This example creates a new 127GB VHD and then mounts, initializes, and formats it so the drive is ready to use. +This example creates a new 127GB VHD and then mounts, initializes, and formats it so the drive is +ready to use. ## PARAMETERS ### -AsJob + Runs the cmdlet as a background job. ```yaml Type: SwitchParameter Parameter Sets: (All) -Aliases: +Aliases: Required: False Position: Named @@ -114,12 +140,13 @@ Accept wildcard characters: False ``` ### -BlockSizeBytes + Specifies the block size, in bytes, of the virtual hard disk to be created. ```yaml Type: UInt32 Parameter Sets: (All) -Aliases: +Aliases: Required: False Position: Named @@ -129,14 +156,16 @@ Accept wildcard characters: False ``` ### -CimSession -Runs the cmdlet in a remote session or on a remote computer. -Enter a computer name or a session object, such as the output of a [New-CimSession](https://go.microsoft.com/fwlink/p/?LinkId=227967) or [Get-CimSession](https://go.microsoft.com/fwlink/p/?LinkId=227966) cmdlet. -The default is the current session on the local computer. + +Runs the cmdlet in a remote session or on a remote computer. Enter a computer name or a session +object, such as the output of a [New-CimSession](https://go.microsoft.com/fwlink/p/?LinkId=227967) +or [Get-CimSession](https://go.microsoft.com/fwlink/p/?LinkId=227966) cmdlet. The default is the +current session on the local computer. ```yaml Type: CimSession[] Parameter Sets: (All) -Aliases: +Aliases: Required: False Position: Named @@ -146,15 +175,15 @@ Accept wildcard characters: False ``` ### -ComputerName + Specifies one or more Hyper-V hosts on which the virtual hard disk file(s) are to be created. -NetBIOS names, IP addresses, and fully qualified domain names are allowable. -The default is the local computer. -Use localhost or a dot (.) to specify the local computer explicitly. +NetBIOS names, IP addresses, and fully qualified domain names are allowable. The default is the +local computer. Use localhost or a dot (.) to specify the local computer explicitly. ```yaml Type: String[] Parameter Sets: (All) -Aliases: +Aliases: Required: False Position: Named @@ -164,6 +193,7 @@ Accept wildcard characters: False ``` ### -Confirm + Prompts you for confirmation before running the cmdlet. ```yaml @@ -179,13 +209,33 @@ Accept wildcard characters: False ``` ### -Credential -Specifies one or more user accounts that have permission to perform this action. -The default is the current user. + +Specifies one or more user accounts that have permission to perform this action. The default is the +current user. ```yaml Type: PSCredential[] Parameter Sets: (All) -Aliases: +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -DataAlignmentBytes + +Specifies the byte alignment for the virtual hard disk file. This parameter is used to optimize the +performance of the VHD file by aligning the disk sectors with the physical sector boundaries of the +underlying storage device. + +```yaml +Type: UInt64 +Parameter Sets: FixedWithoutSource +Aliases: +Accepted values: 0, 1GB, 1073741824 Required: False Position: Named @@ -195,12 +245,13 @@ Accept wildcard characters: False ``` ### -Differencing + Specifies that a differencing virtual hard disk is to be created. ```yaml Type: SwitchParameter Parameter Sets: Differencing -Aliases: +Aliases: Required: False Position: Named @@ -210,12 +261,13 @@ Accept wildcard characters: False ``` ### -Dynamic + Specifies that a dynamic virtual hard disk is to be created. ```yaml Type: SwitchParameter Parameter Sets: DynamicWithoutSource -Aliases: +Aliases: Required: False Position: Named @@ -227,7 +279,7 @@ Accept wildcard characters: False ```yaml Type: SwitchParameter Parameter Sets: DynamicWithSource -Aliases: +Aliases: Required: True Position: Named @@ -237,12 +289,13 @@ Accept wildcard characters: False ``` ### -Fixed + Specifies that a fixed virtual hard disk is to be created. ```yaml Type: SwitchParameter Parameter Sets: FixedWithoutSource, FixedWithSource -Aliases: +Aliases: Required: True Position: Named @@ -252,13 +305,14 @@ Accept wildcard characters: False ``` ### -LogicalSectorSizeBytes -Specifies the logical sector size, in bytes, of the virtual hard disk to be created. -Valid values are 512 and 4096. + +Specifies the logical sector size, in bytes, of the virtual hard disk to be created. Valid values +are 512 and 4096. ```yaml Type: UInt32 Parameter Sets: DynamicWithoutSource, FixedWithoutSource -Aliases: +Aliases: Accepted values: 512, 4096 Required: False @@ -269,12 +323,14 @@ Accept wildcard characters: False ``` ### -ParentPath -Specifies the path to the parent of the differencing disk to be created (this parameter may be specified only for the creation of a differencing disk). + +Specifies the path to the parent of the differencing disk to be created (this parameter may be +specified only for the creation of a differencing disk). ```yaml Type: String Parameter Sets: Differencing -Aliases: +Aliases: Required: True Position: 1 @@ -284,13 +340,15 @@ Accept wildcard characters: False ``` ### -Path -Path to the new virtual hard disk file(s) that is being created as a result of a command. -If a filename or relative path is specified, the new virtual hard disk path is calculated relative to the current working directory. + +Path to the new virtual hard disk file(s) that's being created as a result of a command. If a +filename or relative path is specified, the new virtual hard disk path is calculated relative to the +current working directory. ```yaml Type: String[] Parameter Sets: (All) -Aliases: +Aliases: Required: True Position: 0 @@ -300,13 +358,13 @@ Accept wildcard characters: False ``` ### -PhysicalSectorSizeBytes -Specifies the physical sector size, in bytes. -Valid values are 512 and 4096. + +Specifies the physical sector size, in bytes. Valid values are 512 and 4096. ```yaml Type: UInt32 Parameter Sets: DynamicWithoutSource, Differencing, FixedWithoutSource -Aliases: +Aliases: Accepted values: 512, 4096 Required: False @@ -317,12 +375,13 @@ Accept wildcard characters: False ``` ### -SizeBytes + The maximum size, in bytes, of the virtual hard disk to be created. ```yaml Type: UInt64 Parameter Sets: DynamicWithoutSource, FixedWithoutSource -Aliases: +Aliases: Required: True Position: 1 @@ -334,7 +393,7 @@ Accept wildcard characters: False ```yaml Type: UInt64 Parameter Sets: Differencing -Aliases: +Aliases: Required: False Position: 1 @@ -344,6 +403,7 @@ Accept wildcard characters: False ``` ### -SourceDisk + Specifies the physical disk to be used as the source for the virtual hard disk to be created. ```yaml @@ -359,8 +419,8 @@ Accept wildcard characters: False ``` ### -WhatIf -Shows what would happen if the cmdlet runs. -The cmdlet is not run. + +Shows what would happen if the cmdlet runs. The cmdlet isn't run. ```yaml Type: SwitchParameter @@ -369,16 +429,24 @@ Aliases: wi Required: False Position: Named -Default value: False +Default value: None Accept pipeline input: False Accept wildcard characters: False ``` ### CommonParameters -This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](https://go.microsoft.com/fwlink/?LinkID=113216). + +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, +-InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, +-WarningAction, and -WarningVariable. For more information, see +[about_CommonParameters](https://go.microsoft.com/fwlink/?LinkID=113216). ## INPUTS +### System.String[] + +### System.UInt32 + ## OUTPUTS ### Microsoft.Vhd.PowerShell.VirtualHardDisk @@ -387,3 +455,12 @@ This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable ## RELATED LINKS +- [Convert-VHD](convert-vhd.md) +- [Dismount-VHD](dismount-vhd.md) +- [Get-VHD](get-vhd.md) +- [Merge-VHD](merge-vhd.md) +- [Mount-VHD](mount-vhd.md) +- [Optimize-VHD](optimize-vhd.md) +- [Resize-VHD](resize-vhd.md) +- [Set-VHD](set-vhd.md) +- [Test-VHD](test-vhd.md) diff --git a/docset/winserver2022-ps/hyper-v/Optimize-VHD.md b/docset/winserver2022-ps/hyper-v/Optimize-VHD.md index 04cad74c2f..e03f75bd12 100644 --- a/docset/winserver2022-ps/hyper-v/Optimize-VHD.md +++ b/docset/winserver2022-ps/hyper-v/Optimize-VHD.md @@ -2,7 +2,7 @@ description: Use this topic to help manage Windows and Windows Server technologies with Windows PowerShell. external help file: Microsoft.HyperV.PowerShell.Cmdlets.dll-Help.xml Module Name: Hyper-V -ms.date: 12/20/2016 +ms.date: 06/21/2023 online version: https://learn.microsoft.com/powershell/module/hyper-v/optimize-vhd?view=windowsserver2022-ps&wt.mc_id=ps-gethelp schema: 2.0.0 title: Optimize-VHD @@ -11,59 +11,67 @@ title: Optimize-VHD # Optimize-VHD ## SYNOPSIS -Optimizes the allocation of space used by virtual hard disk files, except for fixed virtual hard disks. +Optimizes the allocation of space used by virtual hard disk files, except for fixed virtual hard +disks. ## SYNTAX ``` -Optimize-VHD [-Path] [-Mode ] [-AsJob] [-Passthru] [-CimSession ] - [-ComputerName ] [-Credential ] [-WhatIf] [-Confirm] [] +Optimize-VHD [-Path] [-Mode ] [-AsJob] [-PassThru] + [-CimSession ] [-ComputerName ] [-Credential ] [-WhatIf] + [-Confirm] [] ``` ## DESCRIPTION -The **Optimize-VHD** cmdlet optimizes the allocation of space in one or more virtual hard disk files, except for fixed virtual hard disks. -The **Compact** operation is used to optimize the files. -This operation reclaims unused blocks as well as rearranges the blocks to be more efficiently packed, which reduces the size of a virtual hard disk file. -To use Optimize-VHD, the virtual hard disk must not be attached or must be attached in read-only mode. +The `Optimize-VHD` cmdlet optimizes the allocation of space in one or more virtual hard disk files, +except for fixed virtual hard disks. The **Compact** operation is used to optimize the files. This +operation reclaims unused blocks as well as rearranges the blocks to be more efficiently packed, +which reduces the size of a virtual hard disk file. -The compact operation can succeed without reducing the file size, if no optimization is possible. +To use `Optimize-VHD`, the virtual hard disk must not be attached or must be attached in read-only +mode. The compact operation can succeed without reducing the file size, if no optimization is +possible. ## EXAMPLES ### Example 1 -``` -PS C:\> Optimize-VHD -Path c:\test\dynamic.vhdx -Mode Full + +```powershell +Optimize-VHD -Path C:\test\dynamic.vhdx -Mode Full ``` -Runs the compact operation in Full mode. -(If the VHDX-format file is not attached as read-only prior to the operation, it will default to Prezeroed mode.) +Runs the compact operation in Full mode. If the VHDX-format file isn't attached as read-only prior +to the operation, it'll default to **Prezeroed** mode. ### Example 2 -``` -PS C:\> Optimize-VHD -Path c:\test\dynamic.vhdx -Mode Retrim + +```powershell +Optimize-VHD -Path C:\test\dynamic.vhdx -Mode Retrim ``` -Runs the compact operation in Retrim mode. -(If the VHDX-format disk is not mounted as read-only prior to the operation, running the cmdlet returns an error.) +Runs the compact operation in **Retrim** mode. If the VHDX-format disk isn't mounted as read-only +prior to the operation, running the cmdlet returns an error. ### Example 3 -``` -PS C:\> Optimize-VHD -Path c:\test\dynamic.vhdx -Mode Quick + +```powershell +Optimize-VHD -Path C:\test\dynamic.vhdx -Mode Quick ``` -Runs the compact operation in Quick mode. -(If the VHDX-format file is not attached as read-only prior to the operation, it defaults to Pretrimmed mode.) +Runs the compact operation in **Quick** mode. If the VHDX-format file isn't attached as read-only +prior to the operation, it defaults to **Pretrimmed** mode. ## PARAMETERS ### -AsJob + Runs the cmdlet as a background job. ```yaml Type: SwitchParameter Parameter Sets: (All) -Aliases: +Aliases: Required: False Position: Named @@ -73,14 +81,16 @@ Accept wildcard characters: False ``` ### -CimSession -Runs the cmdlet in a remote session or on a remote computer. -Enter a computer name or a session object, such as the output of a [New-CimSession](https://go.microsoft.com/fwlink/p/?LinkId=227967) or [Get-CimSession](https://go.microsoft.com/fwlink/p/?LinkId=227966) cmdlet. -The default is the current session on the local computer. + +Runs the cmdlet in a remote session or on a remote computer. Enter a computer name or a session +object, such as the output of a [New-CimSession](https://go.microsoft.com/fwlink/p/?LinkId=227967) +or [Get-CimSession](https://go.microsoft.com/fwlink/p/?LinkId=227966) cmdlet. The default is the +current session on the local computer. ```yaml Type: CimSession[] Parameter Sets: (All) -Aliases: +Aliases: Required: False Position: Named @@ -90,15 +100,15 @@ Accept wildcard characters: False ``` ### -ComputerName -Specifies one or more Hyper-V hosts on which a virtual machine is to be optimized. -NetBIOS names, IP addresses, and fully qualified domain names are allowable. -The default is the local computer. -Use localhost or a dot (.) to specify the local computer explicitly. + +Specifies one or more Hyper-V hosts on which a virtual machine is to be optimized. NetBIOS names, IP +addresses, and fully qualified domain names are allowable. The default is the local computer. Use +localhost or a dot (.) to specify the local computer explicitly. ```yaml Type: String[] Parameter Sets: (All) -Aliases: +Aliases: Required: False Position: Named @@ -108,6 +118,7 @@ Accept wildcard characters: False ``` ### -Confirm + Prompts you for confirmation before running the cmdlet. ```yaml @@ -123,13 +134,14 @@ Accept wildcard characters: False ``` ### -Credential -Specifies one or more user accounts that have permission to perform this action. -The default is the current user. + +Specifies one or more user accounts that have permission to perform this action. The default is the +current user. ```yaml Type: PSCredential[] Parameter Sets: (All) -Aliases: +Aliases: Required: False Position: Named @@ -139,21 +151,35 @@ Accept wildcard characters: False ``` ### -Mode -Specifies the mode in which the virtual hard disk is to be optimized. -For a **VHD** disk, the default mode is **Full**. -For a **VHDX** disk, the default mode is **Quick**. -Valid modes are as follows: -- **Full** scans for zero blocks and reclaims unused blocks. (Allowable only if the virtual hard disk is mounted read-only.) -- **Pretrimmed** performs as **Quick** mode, but does not require the virtual hard disk to be mounted read-only. The detection of unused space is less effective than **Quick** mode (in which the virtual hard disk had been mounted read-only) because the scan cannot query information about free space in the NTFS file system within the virtual hard disk. Useful when the VHDX-format file has been used by operating system instances that are at least Windows 8 or Windows Server 2012, or when this cmdlet has already been run on a .vhdx file in **Retrim** mode. -- **Prezeroed** performs as **Quick** mode, but does not require the virtual hard disk to be mounted read-only. The unused space detection will be less effective than if the virtual hard disk had been mounted read-only as the scan will be unable to query information about free space in the NTFS file system within the virtual hard disk. Useful if a tool was run previously to zero all the free space on the virtual disk as this mode of compaction can then reclaim that space for subsequent block allocations. This form of compaction can also be useful in handling virtual hard disk containing file systems other than NTFS. -- **Quick** reclaims unused blocks, but does not scan for zero blocks. (Allowable only if the virtual hard disk is mounted read-only.) -- **Retrim** sends down retrims without scanning for zero blocks or reclaiming unused blocks. (Allowable only if the virtual hard disk is mounted read-only.) +Specifies the mode in which the virtual hard disk is to be optimized. For a **VHD** disk, the +default mode is **Full**. For a **VHDX** disk, the default mode is **Quick**. Valid modes are as +follows: + +- **Full** scans for zero blocks and reclaims unused blocks. (Allowable only if the virtual hard + disk is mounted read-only.) +- **Pretrimmed** performs as **Quick** mode, but doesn't require the virtual hard disk to be mounted + read-only. The detection of unused space is less effective than **Quick** mode (in which the + virtual hard disk had been mounted read-only) because the scan can't query information about free + space in the NTFS file system within the virtual hard disk. Useful when the VHDX-format file has + been used by operating system instances that are at least Windows 8 or Windows Server 2012, or + when this cmdlet has already been run on a .vhdx file in **Retrim** mode. +- **Prezeroed** performs as **Quick** mode, but doesn't require the virtual hard disk to be mounted + read-only. The unused space detection will be less effective than if the virtual hard disk had + been mounted read-only as the scan will be unable to query information about free space in the + NTFS file system within the virtual hard disk. Useful if a tool was run previously to zero all the + free space on the virtual disk as this mode of compaction can then reclaim that space for + subsequent block allocations. This form of compaction can also be useful in handling virtual hard + disk containing file systems other than NTFS. +- **Quick** reclaims unused blocks, but doesn't scan for zero blocks. (Allowable only if the virtual + hard disk is mounted read-only.) +- **Retrim** sends down retrims without scanning for zero blocks or reclaiming unused blocks. + (Allowable only if the virtual hard disk is mounted read-only.) ```yaml Type: VhdCompactMode Parameter Sets: (All) -Aliases: +Aliases: Accepted values: Full, Quick, Retrim, Pretrimmed, Prezeroed Required: False @@ -163,13 +189,15 @@ Accept pipeline input: False Accept wildcard characters: False ``` -### -Passthru -Specifies that an object is to be passed through to the pipeline representing the virtual hard disk to be optimized. +### -PassThru + +Specifies that an object is to be passed through to the pipeline representing the virtual hard disk +to be optimized. ```yaml Type: SwitchParameter Parameter Sets: (All) -Aliases: +Aliases: Required: False Position: Named @@ -179,6 +207,7 @@ Accept wildcard characters: False ``` ### -Path + Specifies one or more paths to the dynamic or differencing virtual hard disk files to be optimized. ```yaml @@ -194,8 +223,8 @@ Accept wildcard characters: False ``` ### -WhatIf -Shows what would happen if the cmdlet runs. -The cmdlet is not run. + +Shows what would happen if the cmdlet runs. The cmdlet isn't run. ```yaml Type: SwitchParameter @@ -204,16 +233,22 @@ Aliases: wi Required: False Position: Named -Default value: False +Default value: None Accept pipeline input: False Accept wildcard characters: False ``` ### CommonParameters -This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](https://go.microsoft.com/fwlink/?LinkID=113216). + +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, +-InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, +-WarningAction, and -WarningVariable. For more information, see +[about_CommonParameters](https://go.microsoft.com/fwlink/?LinkID=113216). ## INPUTS +### System.String[] + ## OUTPUTS ### Microsoft.Vhd.PowerShell.VirtualHardDisk @@ -222,3 +257,12 @@ This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable ## RELATED LINKS +- [Convert-VHD](convert-vhd.md) +- [Dismount-VHD](dismount-vhd.md) +- [Get-VHD](get-vhd.md) +- [Merge-VHD](merge-vhd.md) +- [Mount-VHD](mount-vhd.md) +- [New-VHD](new-vhd.md) +- [Resize-VHD](resize-vhd.md) +- [Set-VHD](set-vhd.md) +- [Test-VHD](test-vhd.md) diff --git a/docset/winserver2022-ps/hyper-v/Resize-VHD.md b/docset/winserver2022-ps/hyper-v/Resize-VHD.md index 875cdb5c33..6f6dfa367b 100644 --- a/docset/winserver2022-ps/hyper-v/Resize-VHD.md +++ b/docset/winserver2022-ps/hyper-v/Resize-VHD.md @@ -2,7 +2,7 @@ description: Use this topic to help manage Windows and Windows Server technologies with Windows PowerShell. external help file: Microsoft.HyperV.PowerShell.Cmdlets.dll-Help.xml Module Name: Hyper-V -ms.date: 12/20/2016 +ms.date: 06/21/2023 online version: https://learn.microsoft.com/powershell/module/hyper-v/resize-vhd?view=windowsserver2022-ps&wt.mc_id=ps-gethelp schema: 2.0.0 title: Resize-VHD @@ -16,46 +16,61 @@ Resizes a virtual hard disk. ## SYNTAX ### Size (Default) + ``` -Resize-VHD [-Path] [-SizeBytes] [-AsJob] [-Passthru] [-CimSession ] - [-ComputerName ] [-Credential ] [-WhatIf] [-Confirm] [] +Resize-VHD [-Path] [-SizeBytes] [-AsJob] [-PassThru] + [-CimSession ] [-ComputerName ] [-Credential ] [-WhatIf] + [-Confirm] [] ``` ### MinimumSize + ``` -Resize-VHD [-Path] [-ToMinimumSize] [-AsJob] [-Passthru] [-CimSession ] +Resize-VHD [-Path] [-ToMinimumSize] [-AsJob] [-PassThru] [-CimSession ] [-ComputerName ] [-Credential ] [-WhatIf] [-Confirm] [] ``` ## DESCRIPTION -The **Resize-VHD** cmdlet changes the maximum physical size of a virtual hard disk. It can expand both VHD and VHDX files but can shrink only VHDX files. -The shrink operation fails if it would shrink the virtual disk to less than its minimum size (available through the VHDX object's **MinimumSize** property). -If the virtual disk file connects to a virtual machine's IDE chain, you **cannot** resize the virtual disk while the virtual machine is online. -If the virtual disk file connects to a virtual machine's SCSI chain, you **can** resize the virtual disk while the virtual machine is online. +The `Resize-VHD` cmdlet changes the maximum physical size of a virtual hard disk. It can expand both +VHD and VHDX files but can shrink only VHDX files. The shrink operation fails if it would shrink the +virtual disk to less than its minimum size (available through the VHDX object's **MinimumSize** +property). + +If the virtual disk file connects to a virtual machine's IDE chain, you **can't** resize the virtual +disk while the virtual machine is online. + +If the virtual disk file connects to a virtual machine's SCSI chain, you **can** resize the virtual +disk while the virtual machine is online. > [!NOTE] -> Resize-VHD does not remove empty blocks from a dynamically-expanding virtual hard disk file. Use Optimize-VHD instead. +> `Resize-VHD` doesn't remove empty blocks from a dynamically-expanding virtual hard disk file. Use +`Optimize-VHD` instead. ## EXAMPLES ### Example 1 -``` -PS C:\> Resize-VHD -Path c:\BaseVHD.vhd -SizeBytes 1099511627776 + +```powershell +Resize-VHD -Path C:\BaseVHD.vhd -SizeBytes 1099511627776 ``` -Expands the VHD to 1 terabyte if the previous size was less than 1 terabyte. If it was larger, the cmdlet will report an error because it cannot shrink a VHD. +Expands the VHD to 1 terabyte if the previous size was less than 1 terabyte. If it was larger, the +cmdlet will report an error because it can't shrink a VHD. ### Example 2 -``` -PS C:\> Resize-VHD -Path c:\BaseVHDX.vhdx -SizeBytes 20GB + +```powershell +Resize-VHD -Path C:\BaseVHDX.vhdx -SizeBytes 20GB ``` -Changes the VHDX's size to 20 gigabytes (21,474,836,480 bytes). If it was larger, the cmdlet will only succeed if it had a **MinimumSize** less than or equal to 20 gigabytes. +Changes the VHDX's size to 20 gigabytes (21,474,836,480 bytes). If it was larger, the cmdlet will +only succeed if it had a **MinimumSize** less than or equal to 20 gigabytes. ### Example 3 -``` -PS C:\> Resize-VHD -Path c:\BaseVHDX.vhdx -ToMinimumSize + +```powershell +Resize-VHD -Path C:\BaseVHDX.vhdx -ToMinimumSize ``` Shrinks the VHDX to its minimum possible size as indicated in its **MinimumSize** property. @@ -63,12 +78,13 @@ Shrinks the VHDX to its minimum possible size as indicated in its **MinimumSize* ## PARAMETERS ### -AsJob + Runs the cmdlet as a background job. ```yaml Type: SwitchParameter Parameter Sets: (All) -Aliases: +Aliases: Required: False Position: Named @@ -78,14 +94,16 @@ Accept wildcard characters: False ``` ### -CimSession -Runs the cmdlet in a remote session or on a remote computer. -Enter a computer name or a session object, such as the output of a [New-CimSession](https://go.microsoft.com/fwlink/p/?LinkId=227967) or [Get-CimSession](https://go.microsoft.com/fwlink/p/?LinkId=227966) cmdlet. -The default is the current session on the local computer. + +Runs the cmdlet in a remote session or on a remote computer. Enter a computer name or a session +object, such as the output of a [New-CimSession](https://go.microsoft.com/fwlink/p/?LinkId=227967) +or [Get-CimSession](https://go.microsoft.com/fwlink/p/?LinkId=227966) cmdlet. The default is the +current session on the local computer. ```yaml Type: CimSession[] Parameter Sets: (All) -Aliases: +Aliases: Required: False Position: Named @@ -95,15 +113,15 @@ Accept wildcard characters: False ``` ### -ComputerName -Specifies one or more Hyper-V hosts on which a virtual hard disk is to be resized. -NetBIOS names, IP addresses, and fully qualified domain names are allowable. -The default is the local computer. -Use localhost or a dot (.) to specify the local computer explicitly. + +Specifies one or more Hyper-V hosts on which a virtual hard disk is to be resized. NetBIOS names, IP +addresses, and fully qualified domain names are allowable. The default is the local computer. Use +localhost or a dot (.) to specify the local computer explicitly. ```yaml Type: String[] Parameter Sets: (All) -Aliases: +Aliases: Required: False Position: Named @@ -113,6 +131,7 @@ Accept wildcard characters: False ``` ### -Confirm + Prompts you for confirmation before running the cmdlet. ```yaml @@ -128,13 +147,14 @@ Accept wildcard characters: False ``` ### -Credential -Specifies one or more user accounts that have permission to perform this action. -The default is the current user. + +Specifies one or more user accounts that have permission to perform this action. The default is the +current user. ```yaml Type: PSCredential[] Parameter Sets: (All) -Aliases: +Aliases: Required: False Position: Named @@ -143,13 +163,15 @@ Accept pipeline input: False Accept wildcard characters: False ``` -### -Passthru -Specifies that an object representing the resized virtual hard disk is to be passed through to the pipeline. +### -PassThru + +Specifies that an object representing the resized virtual hard disk is to be passed through to the +pipeline. ```yaml Type: SwitchParameter Parameter Sets: (All) -Aliases: +Aliases: Required: False Position: Named @@ -159,7 +181,8 @@ Accept wildcard characters: False ``` ### -Path -Specifies the path to the virtual hard disk that is to be resized. + +Specifies the path to the virtual hard disk that's to be resized. ```yaml Type: String[] @@ -174,12 +197,13 @@ Accept wildcard characters: False ``` ### -SizeBytes + Specifies the size to which the virtual hard disk is to be resized. ```yaml Type: UInt64 Parameter Sets: Size -Aliases: +Aliases: Required: True Position: 1 @@ -189,12 +213,13 @@ Accept wildcard characters: False ``` ### -ToMinimumSize + Specifies that the virtual hard disk is to be resized to its minimum possible size. ```yaml Type: SwitchParameter Parameter Sets: MinimumSize -Aliases: +Aliases: Required: True Position: Named @@ -204,8 +229,8 @@ Accept wildcard characters: False ``` ### -WhatIf -Shows what would happen if the cmdlet runs. -The cmdlet is not run. + +Shows what would happen if the cmdlet runs. The cmdlet isn't run. ```yaml Type: SwitchParameter @@ -214,16 +239,22 @@ Aliases: wi Required: False Position: Named -Default value: False +Default value: None Accept pipeline input: False Accept wildcard characters: False ``` ### CommonParameters -This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](https://go.microsoft.com/fwlink/?LinkID=113216). + +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, +-InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, +-WarningAction, and -WarningVariable. For more information, see +[about_CommonParameters](https://go.microsoft.com/fwlink/?LinkID=113216). ## INPUTS +### System.String[] + ## OUTPUTS ### Microsoft.Vhd.PowerShell.VirtualHardDisk @@ -232,3 +263,12 @@ This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable ## RELATED LINKS +- [Convert-VHD](convert-vhd.md) +- [Dismount-VHD](dismount-vhd.md) +- [Get-VHD](get-vhd.md) +- [Merge-VHD](merge-vhd.md) +- [Mount-VHD](mount-vhd.md) +- [New-VHD](new-vhd.md) +- [Optimize-VHD](optimize-vhd.md) +- [Set-VHD](set-vhd.md) +- [Test-VHD](test-vhd.md) diff --git a/docset/winserver2022-ps/hyper-v/Set-VHD.md b/docset/winserver2022-ps/hyper-v/Set-VHD.md index c82765f42b..e466d73937 100644 --- a/docset/winserver2022-ps/hyper-v/Set-VHD.md +++ b/docset/winserver2022-ps/hyper-v/Set-VHD.md @@ -2,7 +2,7 @@ description: Use this topic to help manage Windows and Windows Server technologies with Windows PowerShell. external help file: Microsoft.HyperV.PowerShell.Cmdlets.dll-Help.xml Module Name: Hyper-V -ms.date: 12/20/2016 +ms.date: 06/21/2023 online version: https://learn.microsoft.com/powershell/module/hyper-v/set-vhd?view=windowsserver2022-ps&wt.mc_id=ps-gethelp schema: 2.0.0 title: Set-VHD @@ -16,59 +16,71 @@ Sets properties associated with a virtual hard disk. ## SYNTAX ### Parent (Default) + ``` -Set-VHD [-Path] [-ParentPath] [-LeafPath ] [-IgnoreIdMismatch] [-Passthru] - [-CimSession ] [-ComputerName ] [-Credential ] [-WhatIf] [-Confirm] - [] +Set-VHD [-Path] [-ParentPath] [-LeafPath ] [-IgnoreIdMismatch] + [-PassThru] [-CimSession ] [-ComputerName ] [-Credential ] +[ -WhatIf] [-Confirm] [] ``` ### PhysicalSectorSize + ``` -Set-VHD [-Path] -PhysicalSectorSizeBytes [-Passthru] [-CimSession ] +Set-VHD [-Path] -PhysicalSectorSizeBytes [-PassThru] [-CimSession ] [-ComputerName ] [-Credential ] [-WhatIf] [-Confirm] [] ``` ### DiskIdentifier + ``` -Set-VHD [-Path] [-ResetDiskIdentifier] [-Force] [-Passthru] [-CimSession ] +Set-VHD [-Path] [-ResetDiskIdentifier] [-Force] [-PassThru] [-CimSession ] [-ComputerName ] [-Credential ] [-WhatIf] [-Confirm] [] ``` ## DESCRIPTION -The **Set-VHD** cmdlet sets the ParentPath or PhysicalSectorSizeBytes properties of a virtual hard disk. -The two properties must be set in separate operations. + +The `Set-VHD` cmdlet sets the **ParentPath** or **PhysicalSectorSizeBytes** properties of a virtual +hard disk. The two properties must be set in separate operations. ## EXAMPLES ### Example 1 -``` -PS C:\> Set-VHD -Path Child1.vhd -ParentPath ParentCopy.vhd -LeafPath Child2.vhd + +```powershell +Set-VHD -Path Child1.vhd -ParentPath ParentCopy.vhd -LeafPath Child2.vhd ``` -This example sets the parent of the virtual hard disk associated with ParentCopy.vhd as the parent of the chained virtual hard disk associated with Child1.vhd, where the leaf of the virtual disk chain is the virtual hard disk associated with Child2.vhd. -The operation is performed in online mode. +This example sets the parent of the virtual hard disk associated with **ParentCopy.vhd** as the +parent of the chained virtual hard disk associated with **Child1.vhd**, where the leaf of the +virtual disk chain is the virtual hard disk associated with **Child2.vhd**. The operation is +performed in online mode. ### Example 2 -``` -PS C:\> Set-VHD -Path Child1.vhd -ParentPath ParentCopy.vhd + +```powershell +Set-VHD -Path Child1.vhd -ParentPath ParentCopy.vhd ``` -This example sets the parent of the virtual hard disk associated with ParentCopy.vhd as the parent of the chained virtual hard disk associated with Child1.vhd. -This operation cannot be performed when the virtual disk chain is attached. +This example sets the parent of the virtual hard disk associated with **ParentCopy.vhd** as the +parent of the chained virtual hard disk associated with **Child1.vhd**. This operation can't be +performed when the virtual disk chain is attached. ### Example 3 -``` -PS C:\> Set-VHD -Path Child1.vhd -parentpath parentcopywithnewid.vhd -IgnoreMismatchId + +```powershell +Set-VHD -Path Child1.vhd -ParentPath parentcopywithnewid.vhd -IgnoreMismatchId ``` -This example sets the parent of Child1.vhd to point to parentcopywithnewid.vhd, even though parentcopywithnewid.vhd has a different ID than the original parent of child1.vhd. -The operation is performed in offline mode. -This mode should be used with extreme caution, and only when it is certain that the block contents of the new and old parents are exactly the same. -Otherwise data loss can occur. +This example sets the parent of Child1.vhd to point to **parentcopywithnewid.vhd**, even though +**parentcopywithnewid.vhd** has a different ID than the original parent of **child1.vhd**. The +operation is performed in offline mode. This mode should be used with extreme caution, and only when +it's certain that the block contents of the new and old parents are exactly the same. Otherwise data +loss can occur. ### Example 4 -``` -PS C:\> Set-VHD -Path c:\test.vhdx -PhysicalSectorSizeBytes 512 + +```powershell +Set-VHD -Path C:\test.vhdx -PhysicalSectorSizeBytes 512 ``` This example sets the physical sector size of a VHDX to 512 bytes. @@ -76,14 +88,16 @@ This example sets the physical sector size of a VHDX to 512 bytes. ## PARAMETERS ### -CimSession -Runs the cmdlet in a remote session or on a remote computer. -Enter a computer name or a session object, such as the output of a [New-CimSession](https://go.microsoft.com/fwlink/p/?LinkId=227967) or [Get-CimSession](https://go.microsoft.com/fwlink/p/?LinkId=227966) cmdlet. -The default is the current session on the local computer. + +Runs the cmdlet in a remote session or on a remote computer. Enter a computer name or a session +object, such as the output of a [New-CimSession](https://go.microsoft.com/fwlink/p/?LinkId=227967) +or [Get-CimSession](https://go.microsoft.com/fwlink/p/?LinkId=227966) cmdlet. The default is the +current session on the local computer. ```yaml Type: CimSession[] Parameter Sets: (All) -Aliases: +Aliases: Required: False Position: Named @@ -93,15 +107,16 @@ Accept wildcard characters: False ``` ### -ComputerName -Specifies one or more Hyper-V hosts on which the parent of a virtual hard disk in a differencing hard disk chain is to be set. -NetBIOS names, IP addresses, and fully qualified domain names are allowable. -The default is the local computer. -Use localhost or a dot (.) to specify the local computer explicitly. + +Specifies one or more Hyper-V hosts on which the parent of a virtual hard disk in a differencing +hard disk chain is to be set. NetBIOS names, IP addresses, and fully qualified domain names are +allowable. The default is the local computer. Use localhost or a dot (.) to specify the local +computer explicitly. ```yaml Type: String[] Parameter Sets: (All) -Aliases: +Aliases: Required: False Position: Named @@ -111,6 +126,7 @@ Accept wildcard characters: False ``` ### -Confirm + Prompts you for confirmation before running the cmdlet. ```yaml @@ -126,13 +142,14 @@ Accept wildcard characters: False ``` ### -Credential -Specifies one or more user accounts that have permission to perform this action. -The default is the current user. + +Specifies one or more user accounts that have permission to perform this action. The default is the +current user. ```yaml Type: PSCredential[] Parameter Sets: (All) -Aliases: +Aliases: Required: False Position: Named @@ -142,12 +159,13 @@ Accept wildcard characters: False ``` ### -Force + Forces the command to run without asking for user confirmation. ```yaml Type: SwitchParameter Parameter Sets: DiskIdentifier -Aliases: +Aliases: Required: False Position: Named @@ -157,12 +175,14 @@ Accept wildcard characters: False ``` ### -IgnoreIdMismatch -Specifies that the check for identifier mismatch between the parent and child virtual hard disk is to be skipped. + +Specifies that the check for identifier mismatch between the parent and child virtual hard disk is +to be skipped. ```yaml Type: SwitchParameter Parameter Sets: Parent -Aliases: +Aliases: Required: False Position: Named @@ -172,13 +192,14 @@ Accept wildcard characters: False ``` ### -LeafPath -Specifies the path to the virtual hard disk file of the virtual hard disk representing the leaf node of the virtual hard disk chain. -Required when performing the operation in online mode. + +Specifies the path to the virtual hard disk file of the virtual hard disk representing the leaf node +of the virtual hard disk chain. Required when performing the operation in online mode. ```yaml Type: String Parameter Sets: Parent -Aliases: +Aliases: Required: False Position: Named @@ -188,13 +209,14 @@ Accept wildcard characters: False ``` ### -ParentPath -Specifies the path to the parent disk of a differencing virtual hard disk. -Can be performed regardless of whether the disk is online or offline. + +Specifies the path to the parent disk of a differencing virtual hard disk. Can be performed +regardless of whether the disk is online or offline. ```yaml Type: String Parameter Sets: Parent -Aliases: +Aliases: Required: True Position: 1 @@ -203,13 +225,15 @@ Accept pipeline input: False Accept wildcard characters: False ``` -### -Passthru -Specifies that an object is to be passed through to the pipeline representing the virtual hard disk whose parent is to be set. +### -PassThru + +Specifies that an object is to be passed through to the pipeline representing the virtual hard disk +whose parent is to be set. ```yaml Type: SwitchParameter Parameter Sets: (All) -Aliases: +Aliases: Required: False Position: Named @@ -219,7 +243,9 @@ Accept wildcard characters: False ``` ### -Path -Specifies the path to the virtual hard disk file of the virtual hard disk drive whose parent in the virtual hard disk chain is to be set. + +Specifies the path to the virtual hard disk file of the virtual hard disk drive whose parent in the +virtual hard disk chain is to be set. ```yaml Type: String @@ -234,14 +260,14 @@ Accept wildcard characters: False ``` ### -PhysicalSectorSizeBytes -Specifies the physical sector size, in bytes. -Valid values are 512 and 4096. -This parameter is supported only on a VHDX-format disk that is not attached when the operation is initiated. + +Specifies the physical sector size, in bytes. Valid values are 512 and 4096. This parameter is +supported only on a VHDX-format disk that'sn't attached when the operation is initiated. ```yaml Type: UInt32 Parameter Sets: PhysicalSectorSize -Aliases: +Aliases: Accepted values: 512, 4096 Required: True @@ -252,14 +278,15 @@ Accept wildcard characters: False ``` ### -ResetDiskIdentifier -Indicates that the cmdlet modifies the disk identifier of the virtual disk associated with the virtual hard disk file. -The disk identifier is the SCSI Vital Product Data (VPD) Page 0x83h identifier associated with a disk. -Use this parameter only for a VHDX-format disk. + +Indicates that the cmdlet modifies the disk identifier of the virtual disk associated with the +virtual hard disk file. The disk identifier is the SCSI Vital Product Data (VPD) Page 0x83h +identifier associated with a disk. Use this parameter only for a VHDX-format disk. ```yaml Type: SwitchParameter Parameter Sets: DiskIdentifier -Aliases: +Aliases: Required: True Position: Named @@ -269,8 +296,8 @@ Accept wildcard characters: False ``` ### -WhatIf -Shows what would happen if the cmdlet runs. -The cmdlet is not run. + +Shows what would happen if the cmdlet runs. The cmdlet isn't run. ```yaml Type: SwitchParameter @@ -279,16 +306,22 @@ Aliases: wi Required: False Position: Named -Default value: False +Default value: None Accept pipeline input: False Accept wildcard characters: False ``` ### CommonParameters -This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](https://go.microsoft.com/fwlink/?LinkID=113216). + +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, +-InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, +-WarningAction, and -WarningVariable. For more information, see +[about_CommonParameters](https://go.microsoft.com/fwlink/?LinkID=113216). ## INPUTS +### System.String + ## OUTPUTS ### Microsoft.Vhd.PowerShell.VirtualHardDisk @@ -297,3 +330,12 @@ This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable ## RELATED LINKS +- [Convert-VHD](convert-vhd.md) +- [Dismount-VHD](dismount-vhd.md) +- [Get-VHD](get-vhd.md) +- [Merge-VHD](merge-vhd.md) +- [Mount-VHD](mount-vhd.md) +- [New-VHD](new-vhd.md) +- [Optimize-VHD](optimize-vhd.md) +- [Resize-VHD](resize-vhd.md) +- [Test-VHD](test-vhd.md) diff --git a/docset/winserver2022-ps/hyper-v/Test-VHD.md b/docset/winserver2022-ps/hyper-v/Test-VHD.md index edcd880157..61432bf681 100644 --- a/docset/winserver2022-ps/hyper-v/Test-VHD.md +++ b/docset/winserver2022-ps/hyper-v/Test-VHD.md @@ -2,7 +2,7 @@ description: Use this topic to help manage Windows and Windows Server technologies with Windows PowerShell. external help file: Microsoft.HyperV.PowerShell.Cmdlets.dll-Help.xml Module Name: Hyper-V -ms.date: 12/20/2016 +ms.date: 06/21/2023 online version: https://learn.microsoft.com/powershell/module/hyper-v/test-vhd?view=windowsserver2022-ps&wt.mc_id=ps-gethelp schema: 2.0.0 title: Test-VHD @@ -11,45 +11,52 @@ title: Test-VHD # Test-VHD ## SYNOPSIS -Tests a virtual hard disk for any problems that would make it unusable. +Tests a virtual hard disk for any problems that'd make it unusable. ## SYNTAX ### ExistingVHD (Default) + ``` Test-VHD [-Path] [-CimSession ] [-ComputerName ] [-Credential ] [] ``` ### SharedDisk + ``` Test-VHD [-Path] [-SupportPersistentReservations] [-CimSession ] [-ComputerName ] [-Credential ] [] ``` ## DESCRIPTION -The **Test-VHD** cmdlet tests a virtual hard disk for any problems that would make it unusable. + +The `Test-VHD` cmdlet tests a virtual hard disk for any problems that'd make it unusable. ## EXAMPLES ### Example 1 -``` -PS C:\> Test-VHD -Path Diff2.vhdx + +```powershell +Test-VHD -Path Diff2.vhdx ``` -Tests whether the virtual hard disk chain is in a usable state that starts with the virtual hard disk associated with Diff2.vhdx. +Tests whether the virtual hard disk chain is in a usable state that starts with the virtual hard +disk associated with **Diff2.vhdx**. ## PARAMETERS ### -CimSession -Runs the cmdlet in a remote session or on a remote computer. -Enter a computer name or a session object, such as the output of a [New-CimSession](https://go.microsoft.com/fwlink/p/?LinkId=227967) or [Get-CimSession](https://go.microsoft.com/fwlink/p/?LinkId=227966) cmdlet. -The default is the current session on the local computer. + +Runs the cmdlet in a remote session or on a remote computer. Enter a computer name or a session +object, such as the output of a [New-CimSession](https://go.microsoft.com/fwlink/p/?LinkId=227967) +or [Get-CimSession](https://go.microsoft.com/fwlink/p/?LinkId=227966) cmdlet. The default is the +current session on the local computer. ```yaml Type: CimSession[] Parameter Sets: (All) -Aliases: +Aliases: Required: False Position: Named @@ -59,15 +66,15 @@ Accept wildcard characters: False ``` ### -ComputerName -Specifies one or more Hyper-V hosts on which the virtual hard disk is to be tested. -NetBIOS names, IP addresses, and fully qualified domain names are allowable. -The default is the local computer. -Use localhost or a dot (.) to specify the local computer explicitly. + +Specifies one or more Hyper-V hosts on which the virtual hard disk is to be tested. NetBIOS names, +IP addresses, and fully qualified domain names are allowable. The default is the local computer. Use +localhost or a dot (.) to specify the local computer explicitly. ```yaml Type: String[] Parameter Sets: (All) -Aliases: +Aliases: Required: False Position: Named @@ -77,13 +84,14 @@ Accept wildcard characters: False ``` ### -Credential -Specifies one or more user accounts that have permission to perform this action. -The default is the current user. + +Specifies one or more user accounts that have permission to perform this action. The default is the +current user. ```yaml Type: PSCredential[] Parameter Sets: (All) -Aliases: +Aliases: Required: False Position: Named @@ -93,8 +101,10 @@ Accept wildcard characters: False ``` ### -Path -Specifies the path to the virtual hard disk file of the virtual hard disk to be tested. -If a filename or relative path is specified, the new virtual hard disk path is calculated relative to the current working directory. + +Specifies the path to the virtual hard disk file of the virtual hard disk to be tested. If a +filename or relative path is specified, the new virtual hard disk path is calculated relative to the +current working directory. ```yaml Type: String[] @@ -109,8 +119,9 @@ Accept wildcard characters: False ``` ### -SupportPersistentReservations -Indicates that the cmdlet tests for SCSI persistent reservation support semantics. -Specify this parameter to test whether a virtual hard disk or path supports shared virtual disks. + +Indicates that the cmdlet tests for SCSI persistent reservation support semantics. Specify this +parameter to test whether a virtual hard disk or path supports shared virtual disks. ```yaml Type: SwitchParameter @@ -125,10 +136,16 @@ Accept wildcard characters: False ``` ### CommonParameters -This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](https://go.microsoft.com/fwlink/?LinkID=113216). + +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, +-InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, +-WarningAction, and -WarningVariable. For more information, see +[about_CommonParameters](https://go.microsoft.com/fwlink/?LinkID=113216). ## INPUTS +### System.String[] + ## OUTPUTS ### System.Boolean @@ -137,3 +154,12 @@ This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable ## RELATED LINKS +- [Convert-VHD](convert-vhd.md) +- [Dismount-VHD](dismount-vhd.md) +- [Get-VHD](get-vhd.md) +- [Merge-VHD](merge-vhd.md) +- [Mount-VHD](mount-vhd.md) +- [New-VHD](new-vhd.md) +- [Optimize-VHD](optimize-vhd.md) +- [Resize-VHD](resize-vhd.md) +- [Set-VHD](set-vhd.md)