Set-VM

Set-VM

Configures a virtual machine.

Syntax

Parameter Set: Name
Set-VM [-Name] <String[]> [-AllowUnverifiedPaths] [-AutomaticCriticalErrorAction <Nullable [Microsoft.HyperV.PowerShell.CriticalErrorAction]> ] [-AutomaticCriticalErrorActionTimeout <Nullable [System.Int32]> ] [-AutomaticStartAction <StartAction]> ] [-AutomaticStartDelay <Int32]> ] [-AutomaticStopAction <StopAction]> ] [-CheckpointType <Nullable [Microsoft.HyperV.PowerShell.CheckpointType]> ] [-CimSession <Microsoft.Management.Infrastructure.CimSession[]> ] [-ComputerName <String[]> ] [-Credential <System.Management.Automation.PSCredential[]> ] [-DynamicMemory] [-GuestControlledCacheTypes <System.Boolean> ] [-LockOnDisconnect <Nullable [Microsoft.HyperV.PowerShell.OnOffState]> ] [-MemoryMaximumBytes <Int64]> ] [-MemoryMinimumBytes <Int64]> ] [-MemoryStartupBytes <Int64]> ] [-NewVMName <String> ] [-Notes <String> ] [-Passthru] [-ProcessorCount <Int64]> ] [-SmartPagingFilePath <String> ] [-SnapshotFileLocation <String> ] [-StaticMemory] [-Confirm] [-WhatIf] [ <CommonParameters>]

Parameter Set: VMObject
Set-VM [-VM] <VirtualMachine[]> [-AllowUnverifiedPaths] [-AutomaticCriticalErrorAction <Nullable [Microsoft.HyperV.PowerShell.CriticalErrorAction]> ] [-AutomaticCriticalErrorActionTimeout <Nullable [System.Int32]> ] [-AutomaticStartAction <StartAction]> ] [-AutomaticStartDelay <Int32]> ] [-AutomaticStopAction <StopAction]> ] [-CheckpointType <Nullable [Microsoft.HyperV.PowerShell.CheckpointType]> ] [-DynamicMemory] [-GuestControlledCacheTypes <System.Boolean> ] [-LockOnDisconnect <Nullable [Microsoft.HyperV.PowerShell.OnOffState]> ] [-MemoryMaximumBytes <Int64]> ] [-MemoryMinimumBytes <Int64]> ] [-MemoryStartupBytes <Int64]> ] [-NewVMName <String> ] [-Notes <String> ] [-Passthru] [-ProcessorCount <Int64]> ] [-SmartPagingFilePath <String> ] [-SnapshotFileLocation <String> ] [-StaticMemory] [-Confirm] [-WhatIf] [ <CommonParameters>]

Detaillierte Beschreibung

The Set-VM cmdlet configures a virtual machine.

Parameter

-AutomaticCriticalErrorAction<Nullable [Microsoft.HyperV.PowerShell.CriticalErrorAction]>

Specifies the action to take when the VM encounters a critical error, and exceeds the timeout duration specified by the AutomaticCriticalErrorActionTimeout cmdlet. Die zulässigen Werte für diesen Parameter sind: Pause and None.

Aliase

none

Erforderlich?

false

Position?

named

Standardwert

none

Pipelineeingaben akzeptieren?

false

Platzhalterzeichen akzeptieren?

false

-AutomaticCriticalErrorActionTimeout<Nullable [System.Int32]>

Specifies the amount of time, in minutes, to wait in critical pause before powering off the virtual machine.

Aliase

none

Erforderlich?

false

Position?

named

Standardwert

none

Pipelineeingaben akzeptieren?

false

Platzhalterzeichen akzeptieren?

false

-AutomaticStartAction<StartAction]>

Specifies the action the virtual machine is to take upon start. Allowed values are Nothing, StartIfRunning, and Start.

Aliase

none

Erforderlich?

false

Position?

named

Standardwert

none

Pipelineeingaben akzeptieren?

false

Platzhalterzeichen akzeptieren?

false

-AutomaticStartDelay<Int32]>

Specifies the number of seconds by which the virtual machine’s start should be delayed.

Aliase

none

Erforderlich?

false

Position?

named

Standardwert

none

Pipelineeingaben akzeptieren?

false

Platzhalterzeichen akzeptieren?

false

-AutomaticStopAction<StopAction]>

Specifies the action the virtual machine is to take when the virtual machine host shuts down. Allowed values are TurnOff, Save, and ShutDown.

Aliase

none

Erforderlich?

false

Position?

named

Standardwert

none

Pipelineeingaben akzeptieren?

false

Platzhalterzeichen akzeptieren?

false

-CheckpointType<Nullable [Microsoft.HyperV.PowerShell.CheckpointType]>

Allows you to configure the type of checkpoints created by Hyper-V. Die zulässigen Werte für diesen Parameter sind:

-- Disabled. Block creation of checkpoints.
-- Standard. Create standard checkpoints.
-- Production. Create production checkpoints if supported by guest operating system. Otherwise, create standard checkpoints.
-- ProductionOnly. Create production checkpoints if supported by guest operating system. Otherwise, the operation fails.

Aliase

none

Erforderlich?

false

Position?

named

Standardwert

none

Pipelineeingaben akzeptieren?

false

Platzhalterzeichen akzeptieren?

false

-CimSession<Microsoft.Management.Infrastructure.CimSession[]>

Das Cmdlet wird in einer Remotesitzung oder auf einem Remotecomputer ausgeführt. Geben Sie einen Computernamen oder ein Sitzungsobjekt ein, wie z. B. die Ausgabe eines New-CimSession oder Get-CimSession-Cmdlets. Der Standardwert ist die aktuelle Sitzung auf dem lokalen Computer.

Aliase

none

Erforderlich?

false

Position?

named

Standardwert

none

Pipelineeingaben akzeptieren?

false

Platzhalterzeichen akzeptieren?

false

-ComputerName<String[]>

Specifies one or more Hyper-V hosts on which the virtual machine is to be configured. 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.

Aliase

none

Erforderlich?

false

Position?

named

Standardwert

none

Pipelineeingaben akzeptieren?

false

Platzhalterzeichen akzeptieren?

false

-Credential<System.Management.Automation.PSCredential[]>

Specifies one or more user accounts that have permission to perform this action. The default is the current user.

Aliase

none

Erforderlich?

false

Position?

named

Standardwert

none

Pipelineeingaben akzeptieren?

false

Platzhalterzeichen akzeptieren?

false

-DynamicMemory

Specifies that the virtual machine is to be configured to use dynamic memory.

Aliase

none

Erforderlich?

false

Position?

named

Standardwert

none

Pipelineeingaben akzeptieren?

false

Platzhalterzeichen akzeptieren?

false

-GuestControlledCacheTypes<System.Boolean>

Specifies whether this virtual machine uses guest controlled cache types.

Aliase

none

Erforderlich?

false

Position?

named

Standardwert

none

Pipelineeingaben akzeptieren?

false

Platzhalterzeichen akzeptieren?

false

-LockOnDisconnect<Nullable [Microsoft.HyperV.PowerShell.OnOffState]>

Specifies whether virtual machine connection in basic mode locks the console after a user disconnects.

Aliase

none

Erforderlich?

false

Position?

named

Standardwert

none

Pipelineeingaben akzeptieren?

false

Platzhalterzeichen akzeptieren?

false

-MemoryMaximumBytes<Int64]>

Specifies the maximum amount of memory that the virtual machine is to be allocated. (Applies only to virtual machines using dynamic memory.)

Aliase

none

Erforderlich?

false

Position?

named

Standardwert

none

Pipelineeingaben akzeptieren?

false

Platzhalterzeichen akzeptieren?

false

-MemoryMinimumBytes<Int64]>

Specifies the minimum amount of memory that the virtual machine is to be allocated. (Applies only to virtual machines using dynamic memory.)

Aliase

none

Erforderlich?

false

Position?

named

Standardwert

none

Pipelineeingaben akzeptieren?

false

Platzhalterzeichen akzeptieren?

false

-MemoryStartupBytes<Int64]>

Specifies the amount of memory that the virtual machine is to be allocated upon startup. (If the virtual machine does not use dynamic memory, then this is the static amount of memory to be allocated.)

Aliase

none

Erforderlich?

false

Position?

named

Standardwert

none

Pipelineeingaben akzeptieren?

false

Platzhalterzeichen akzeptieren?

false

-Name<String[]>

Specifies the name of the virtual machine to be configured.

Aliase

VMName

Erforderlich?

true

Position?

1

Standardwert

none

Pipelineeingaben akzeptieren?

True (ByValue)

Platzhalterzeichen akzeptieren?

false

-NewVMName<String>

Specifies the name to which the virtual machine is to be renamed.

Aliase

none

Erforderlich?

false

Position?

named

Standardwert

none

Pipelineeingaben akzeptieren?

false

Platzhalterzeichen akzeptieren?

false

-Passthru

Specifies that an object is to be passed through to the pipeline representing the virtual machine to be configured.

Aliase

none

Erforderlich?

false

Position?

named

Standardwert

none

Pipelineeingaben akzeptieren?

false

Platzhalterzeichen akzeptieren?

false

-ProcessorCount<Int64]>

Specifies the number of virtual processors for the virtual machine.

Aliase

none

Erforderlich?

false

Position?

named

Standardwert

none

Pipelineeingaben akzeptieren?

false

Platzhalterzeichen akzeptieren?

false

-SnapshotFileLocation<String>

Specifies the folder in which the virtual machine is to store its snapshot files.

Aliase

none

Erforderlich?

false

Position?

named

Standardwert

none

Pipelineeingaben akzeptieren?

false

Platzhalterzeichen akzeptieren?

false

-StaticMemory

This cmdlet configures the virtual machine to use static memory. Specify the amount of static memory to allocate by using the MemoryStartupBytes parameter.

Aliase

none

Erforderlich?

false

Position?

named

Standardwert

none

Pipelineeingaben akzeptieren?

false

Platzhalterzeichen akzeptieren?

false

-VM<VirtualMachine[]>

Specifies the virtual machine to be configured.

Aliase

none

Erforderlich?

true

Position?

1

Standardwert

none

Pipelineeingaben akzeptieren?

True (ByValue)

Platzhalterzeichen akzeptieren?

false

-AllowUnverifiedPaths

Specifies that no error is to be thrown if the specified path is not verified as accessible by the cluster. This parameter is applicable to clustered virtual machines.

Aliase

none

Erforderlich?

false

Position?

named

Standardwert

none

Pipelineeingaben akzeptieren?

false

Platzhalterzeichen akzeptieren?

false

-SmartPagingFilePath<String>

Specifies the folder in which the Smart Paging file is to be stored.

Aliase

none

Erforderlich?

false

Position?

named

Standardwert

none

Pipelineeingaben akzeptieren?

false

Platzhalterzeichen akzeptieren?

false

-Notes<String>

Specifies notes to be associated with the virtual machine.

Aliase

none

Erforderlich?

false

Position?

named

Standardwert

none

Pipelineeingaben akzeptieren?

false

Platzhalterzeichen akzeptieren?

false

-Confirm

Fordert Sie vor der Ausführung des Cmdlet zum Bestätigen auf.

Erforderlich?

false

Position?

named

Standardwert

false

Pipelineeingaben akzeptieren?

false

Platzhalterzeichen akzeptieren?

false

-WhatIf

Zeit, was passieren würde, wenn das Cmdlet ausgeführt wird. Das Cmdlet wird nicht ausgeführt.

Erforderlich?

false

Position?

named

Standardwert

false

Pipelineeingaben akzeptieren?

false

Platzhalterzeichen akzeptieren?

false

<CommonParameters>

Dieses Cmdlet unterstützt die allgemeinen Parameter: -Verbose, -Debug, -ErrorAction, -ErrorVariable, -OutBuffer und -OutVariable. Weitere Informationen finden Sie unter about_CommonParameters (https://go.microsoft.com/fwlink/p/?LinkID=113216).

Eingaben

Der Eingabetyp ist der Typ der Objekte, die Sie per Piping an das Cmdlet übergeben können.

Ausgaben

Der Ausgabetyp ist der Typ der Objekte, die vom Cmdlet ausgegeben werden.

  • None by default; Microsoft.HyperV.PowerShell.VirtualMachine if –PassThru is specified.

Beispiele

Example 1

Configures virtual machine TestVM to shut down when the Hyper-V host shuts down.

PS C:\> Set-VM –Name TestVM –AutomaticStopAction Shutdown

Example 2

Stops virtual machine TestVM, sets it to use dynamic memory, sets its maximum amount of memory to 2GB, sets it to use 2 virtual processors, and starts it.

PS C:\> Stop-VM -Name TestVM -Passthru | Set-VM -ProcessorCount 2 -DynamicMemory -MemoryMaximumBytes 2GB -Passthru | Start-VM