Skip to content

Instantly share code, notes, and snippets.

@rdronov
rdronov / Get-VMHostCoreDumpLocation.ps1
Created October 11, 2018 02:41
This script checks the core dump location for ESXi hosts.
# File name: Get-VMHostCoredumpLocation.ps1
# Description: This script checks the core dump location for ESXi hosts.
#
# 11/10/2018 - Version 1.0
# - Initial Release
#
# Author: Roman Dronov (c)
# Get information about the core dump location for ESXi hosts
@rdronov
rdronov / KS.CFG
Last active April 27, 2019 12:01
# Accept VMware EULA
accepteula
# Set the root password (default: VMware!)
rootpw --iscrypted $1$DK/hzmaO$ZFEGEeAv3rNc8gqvhY2it1
# Clear VMFS partitions (if exist) on the USB drive
clearpart --drives=/vmfs/devices/disks/mpx.vmhbaXX:C0:T0:L0
# Install ESXi on the USB drive
# File name: Remove-VMHostCoredumpLocation.ps1
# Description: This script removes a core dump file for the particular ESXi host.
#
# 11/03/2019 - Version 1.0
# - Initial release
#
# Author: Roman Dronov (c)
# Define common functions
# File name: Remove-OldPowerCLI.ps1
# Description: This script removes the old versions of VMware.PowerCLI and its dependencies
#
# 21/12/2018 - Version 1.0
# - Initial Release (based on https://windowsserver.uservoice.com/forums/301869-powershell/suggestions/14934876-update-module-needs-flag-to-remove-previous-versio)
#
# Author: Roman Dronov (c)
$modules = @((Get-Module -ListAvailable | ? {$_.Name -like "VMware*"}).Name | Get-Unique)
@rdronov
rdronov / Get-VMVideoCard3DEnabled.ps1
Last active October 12, 2018 01:40
This script checks the 3D support enabled for virtual machines
# File name: Get-VMVideoCard3DEnabled.ps1
# Description: This script checks the 3D support enabled for virtual machines. This is
# related to https://www.vmware.com/security/advisories/VMSA-2018-0025.html.
#
# 12/10/2018 - Version 1.0
# - Initial Release
#
# Author: Roman Dronov (c)
# File name: New-VMHostSystemSwapLocation.ps1
# Description: This script creates a system swap file for the ESXi host on a desired datastore.
#
# 08/10/2018 - Version 1.0
# - Initial Release (based on https://code.vmware.com/forums/2530/vsphere-powercli#534332)
#
# Author: Roman Dronov (c)
# Get the host name and check it is valid
# File name: Get-VMHostSystemSwapLocation.ps1
# Description: This script provides information about the system swap location for ESXi hosts.
#
# 08/10/2018 - Version 1.0
# - Initial Release (based on https://code.vmware.com/forums/2530/vsphere-powercli#534332)
#
# Author: Roman Dronov (c)
# Get information about the system swap location for ESXi hosts
# File name: Set-EFIFirmware.ps1
#
# Description: This script checks and sets the firmware type to EFI for a particular VM
#
# 26/07/2018 - Version 1.0
# - Initial Release
#
# Author: Roman Dronov (c)
# File name: Get-DatastoreUsage.ps1
# Description: This script provides information about datastore usage.
#
# 17/07/2018 - Version 1.0
# - Initial Release (based on https://code.vmware.com/forums/2530/vsphere-powercli#576268)
#
# Author: Roman Dronov (c)
Get-Datastore | select Name,`
@{N='Capacity (GB)';E={[math]::Round($_.ExtensionData.Summary.Capacity/1GB,2)}},`
# File name: Get-DirectPathIOStatus.ps1
# Description: VMXNET3 - Network DirectPath I/O Status
# VMware KB: https://kb.vmware.com/kb/2145889
#
# 06/07/2018 - Version 1.1
# - Added the PowerCLI version check
# - Improved the host connection block
# - Added an export to CSV
# 26/04/2017 - Version 1.0
# - Initial Release