First you need to install the BOSH PS Modules according to the following documentation:
https://docs.pivotal.io/pivotalcf/2-3/windows/create-vsphere-stemcell.html#bosh-ps-modulesAfter Step 4 in the Install the BOSH PS Modules section in the documentation, or after Unzip the archive with the following command, please run the following function in Windows VM, derived from BOSH PS Modules.
Upgrade-PSVersion
Now the version of PowerShell is upgraded to v5 automatically and
Apply Changes won't fail.
IMPORTANT NOTE: You then must must proceed with the remaining steps in the above documentation. In other words, install the Cloud Foundry Diego Cell requirements.