Fails to finish Apply Changes with Microsoft.PowerShell.Commands.WriteErrorException if creating and applying a vSphere Windows Stemcell
search cancel

Fails to finish Apply Changes with Microsoft.PowerShell.Commands.WriteErrorException if creating and applying a vSphere Windows Stemcell

book

Article ID: 297675

calendar_today

Updated On:

Products

VMware Tanzu Application Service for VMs

Issue/Introduction

Symptoms:
You may fail to finish Apply Changes with the following error after creating and applying a vSphere Windows Stemcell:
, Stderr:     C:\var\vcap\packages\golang-1-windows\go\src\code.cloudfoundry.org\certsplitter\cmd\certsplitter (from $GOROOT)
    C:\Windows\system32\config\systemprofile\go\src\code.cloudfoundry.org\certsplitter\cmd\certsplitter (from $GOPATH)
iex (get-content -raw packaging) : Error compiling: 
code.cloudfoundry.org/certsplitter/cmd/certsplitter
At line:27 char:5
+     Write-Error "Error compiling: ${pkg_path}"
+     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   + CategoryInfo          : NotSpecified: (:) [Write-Error], WriteErrorExcep 
  tion
   + FullyQualifiedErrorId : Microsoft.PowerShell.Commands.WriteErrorExceptio 
  n

Environment


Cause

The $GOPATH shown above in the Symptom does not execute successfully because you need to have PowerShell v5 to create the Windows Stemcell but this version is not applied.

Resolution

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-modules

After 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.