I recently adjusted some Transparent Page Sharing setting in the HomeLab to maximise the RAM availability which led me to consider how to do this in PowerShell for someone at scale.

Details of TPS settings and available Salting settings can be found here

Setting the Salting setting can be done be changing the value for the ‘Mem.ShareForceSalting’ advanced settings on an ESX Host or ‘sched.mem.pshare.salt’ setting a a VM level. The above article covers this off with a useful matrix.

Here is a code snippet you can use to list out the setting value for each host:

Get-VMHost |
Get-AdvancedSetting -Name 'Mem.ShareForceSalting' |
Select @{N='VMHost';E={$_.Entity.Name}},Name,Value
VMHost Name Value
esxi01.tsh.cloud Mem.ShareForceSalting 0
esxi02.tsh.cloud Mem.ShareForceSalting 0
esxi03.tsh.cloud Mem.ShareForceSalting 0
esxi04.tsh.cloud Mem.ShareForceSalting 0
esxi05.tsh.cloud Mem.ShareForceSalting 2
esxi06.tsh.cloud Mem.ShareForceSalting 2
esxi07.tsh.cloud Mem.ShareForceSalting 2

As always, thanks for reading!

If you like my content, consider following me on Twitter so you don’t miss out!

Follow @vStephanMcTighe