Handy one-liners
Every once in a while you stumble upon a one-liner that you want to remember. So where do you keep those? Here!
Clear VCSA Backup History
rm /storage/applmgmt/backup_restore/backup-history.json
Reset VAMI Update Status
rm /etc/applmgmt/appliance/software_update_state.conf
Restart Management Agents
services.sh restart &tail -f /var/log/jumpstart-stdout.log
Finding Templates based on Tag name
(Get-Template | Get-TagAssignment | ?{$_.Tag.Name -eq "Name"} | Select Entity).Entity
Change Windows Server Evaluation to licensed edition
DISM /Online /Get-CurrentEdition
DISM /Online /Get-TargetEditions
DISM /Online /Set-Edition:ServerDatacenter /ProductKey:XXXXX-XXXXX-XXXXX-XXXXX-XXXXX /AcceptEula
For product keys check this link.
Install VMware PowerCLI
Install-PackageProvider -Name NuGet -MinimumVersion 2.8.5.201 -Force
Set-PSRepository -Name PSGallery -InstallationPolicy Trusted
Install-Module -Name VMware.PowerCLI
Fix ESXi “no boot device found”
Boot with FreeBSD boot device
efibootmgr -v
Check device that ESXi partition uses
fsck_msdosfs /dev/<device>
Install SSH Server on Windows Server
Get-WindowsCapability -online | ?{$_.Name -like "OpenSSH.Server*"} | Add-WindowsCapability -online
Copy files with SCP
scp <file> user@server:path