< Back

Set-VsphereVm

Sat Jan 18, 2020 9:38 am

NAME Set-VsphereVm



SYNOPSIS

Modifies the properties and/or devices of an existing VM.





SYNTAX

Set-VsphereVm -SetType {CD/DVD Drive | CPU | Hard Disk | Memory | Network Adapter | VM Properties} -VmId <String>

[-DeviceKey <Nullable[Int32]>] [-DiskSizeMb <Int64>] -Connection <Hashtable> [<CommonParameters>]



Set-VsphereVm -SetType {CD/DVD Drive | CPU | Hard Disk | Memory | Network Adapter | VM Properties} -VmId <String>

[-ConnectAtPowerOn <Nullable[Boolean]>] [-DeviceKey <Nullable[Int32]>] -CdDriveType {Client Device | Datastore ISO

File | Host Device} -IsoFilePath <String> [-IsoDatastoreId <String>] -Connection <Hashtable> [<CommonParameters>]



Set-VsphereVm -SetType {CD/DVD Drive | CPU | Hard Disk | Memory | Network Adapter | VM Properties} -VmId <String>

[-DeviceKey <Nullable[Int32]>] -CdDriveType {Client Device | Datastore ISO File | Host Device} -Connection

<Hashtable> [<CommonParameters>]



Set-VsphereVm -SetType {CD/DVD Drive | CPU | Hard Disk | Memory | Network Adapter | VM Properties} -VmId <String>

[-ConnectAtPowerOn <Nullable[Boolean]>] [-DeviceKey <Nullable[Int32]>] -CdDriveType {Client Device | Datastore ISO

File | Host Device} -HostDevicePath <String> -Connection <Hashtable> [<CommonParameters>]



Set-VsphereVm -SetType {CD/DVD Drive | CPU | Hard Disk | Memory | Network Adapter | VM Properties} -VmId <String>

[-CoresPerSocket <Int32>] [-TotalCores <Int32>] -Connection <Hashtable> [<CommonParameters>]



Set-VsphereVm -SetType {CD/DVD Drive | CPU | Hard Disk | Memory | Network Adapter | VM Properties} -VmId <String>

[-MemoryMb <Int64>] -Connection <Hashtable> [<CommonParameters>]



Set-VsphereVm -SetType {CD/DVD Drive | CPU | Hard Disk | Memory | Network Adapter | VM Properties} -VmId <String>

[-ConnectAtPowerOn <Nullable[Boolean]>] [-DeviceKey <Nullable[Int32]>] -NetworkId <String> -Connection <Hashtable>

[<CommonParameters>]



Set-VsphereVm -SetType {CD/DVD Drive | CPU | Hard Disk | Memory | Network Adapter | VM Properties} -VmId <String>

[-Description <String>] [-GuestOsId <String>] [-VmName <String>] -Connection <Hashtable> [<CommonParameters>]





DESCRIPTION

Modifies the properties and/or devices of an existing VM.





PARAMETERS

-SetType <String>

Specifies which part of the VM is to be modified. Accepted values are:

CD/DVD Drive

CPU

Hard Disk

Memory

Network Adapter

VM Properties



Required? true

Position? named

Default value

Accept pipeline input? False

Accept wildcard characters? false



-VmId <String>

ID (managed object reference) of the VM that is modified.



Required? true

Position? named

Default value

Accept pipeline input? False

Accept wildcard characters? false



-DeviceKey [<Nullable[Int32]>]

Specifies the device to be modified. When not specified, the first device found, if any, is modified.



Required? false

Position? named

Default value

Accept pipeline input? False

Accept wildcard characters? false



-DiskSizeMb [<Int64>]

Specifies the new disk size, in MB.



Required? false

Position? named

Default value

Accept pipeline input? False

Accept wildcard characters? false



-Connection <Hashtable>

Specifies connection information to the vCenter server. For example:

@{ServerUrl='<vCenter Server URL>';User='<user>';Password='<password>';LicenseKey=<license

key>;SkipCertificateValidation=$false}



Required? true

Position? named

Default value

Accept pipeline input? False

Accept wildcard characters? false



-ConnectAtPowerOn [<Nullable[Boolean]>]

Specifies if the device should be connected when the VM powers on.



Required? false

Position? named

Default value

Accept pipeline input? False

Accept wildcard characters? false



-CdDriveType <String>

Specifies a new CD/DVD drive type when changing to a different drive type. Specifies the CD/DVD drive type of

the drive that is to be modified when modifying properties of a drive.

This parameter is only available when SetType is CD/DVD Drive. Accepted values are:

Client Device

Datastore ISO File

Host Device



Required? true

Position? named

Default value

Accept pipeline input? False

Accept wildcard characters? false



-IsoFilePath <String>

Location of the datastore ISO file for the device, in the form [<datastore name>] <ISO file Path>. For Example:

[DS-DEV-01] ISO/windows/ windows_10_x64.iso





Required? true

Position? named

Default value

Accept pipeline input? False

Accept wildcard characters? false



-IsoDatastoreId [<String>]

ID (managed object reference) of the datastore where the ISO file is stored. The datastore must correspond to

the datastore specified in the ISO File Path.



Required? false

Position? named

Default value

Accept pipeline input? False

Accept wildcard characters? false



-HostDevicePath <String>

Location of host device.



Required? true

Position? named

Default value

Accept pipeline input? False

Accept wildcard characters? false



-CoresPerSocket [<Int32>]

Number of CPU cores per socket for the modified VM.



Required? false

Position? named

Default value

Accept pipeline input? False

Accept wildcard characters? false



-TotalCores [<Int32>]

Total number of CPU cores for the modified VM.



Required? false

Position? named

Default value

Accept pipeline input? False

Accept wildcard characters? false



-MemoryMb [<Int64>]

Specifies the amount of memory, in MB, for the modified VM.



Required? false

Position? named

Default value

Accept pipeline input? False

Accept wildcard characters? false



-NetworkId <String>

ID (managed object reference) of the network to be assigned to the network adapter.



Required? true

Position? named

Default value

Accept pipeline input? False

Accept wildcard characters? false



-Description [<String>]

Specifies a new description for the VM.



Required? false

Position? named

Default value

Accept pipeline input? False

Accept wildcard characters? false



-GuestOsId [<String>]

Specifies a new Guest OS for the VM.



Required? false

Position? named

Default value

Accept pipeline input? False

Accept wildcard characters? false



-VmName [<String>]

Specifies a new name for the VM.



Required? false

Position? named

Default value

Accept pipeline input? False

Accept wildcard characters? false



<CommonParameters>

This cmdlet supports the common parameters: Verbose, Debug,

ErrorAction, ErrorVariable, WarningAction, WarningVariable,

OutBuffer, PipelineVariable, and OutVariable. For more information, see

about_CommonParameters (https:/go.microsoft.com/fwlink/?LinkID=113216).



INPUTS

None







OUTPUTS

System.String

ID (managed object reference) of the VM.







RELATED LINKS