I had a need recently to switch the applied storage policy across a ton of VMs, but I didn’t want to change the default policy that comes out of the box. A tough proposition as I found no easy way to do it. It took quite a bit of googling and trial and error but I came up with this two liner to get it done, so here you go world – go forth and policy change if you need such a thing.
The first line applies it to the VM object, then the next applies it to all the disks. Easy peasy.
Get-Cluster "ClusterName" | Get-VM | Set-SpbmEntityConfiguration -StoragePolicy "My new policy"
Get-Cluster "ClusterName" | Get-VM | Get-HardDisk | Set-SpbmEntityConfiguration -StoragePolicy "My new policy"