Skip to content

Commit afb1300

Browse files
committed
stembuild: vmconstruct code cleanup
- rename constant for clarity - use backtick to elimiate string escaping
1 parent 5e9f491 commit afb1300

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

stembuild/construct/vmconstruct.go

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,13 +42,15 @@ type VMConstruct struct {
4242
SetupFlags []string
4343
}
4444

45-
const provisionDir = "C:\\provision\\"
45+
const powershellExePath = `C:\Windows\System32\WindowsPowerShell\V1.0\powershell.exe`
46+
47+
const provisionDir = `C:\provision\`
4648
const stemcellAutomationName = "StemcellAutomation.zip"
4749
const stemcellAutomationDest = provisionDir + stemcellAutomationName
4850
const lgpoDest = provisionDir + "LGPO.zip"
4951
const stemcellAutomationSetupScript = provisionDir + "Setup.ps1"
5052
const stemcellAutomationPostRebootScript = provisionDir + "PostReboot.ps1"
51-
const powershell = "C:\\Windows\\System32\\WindowsPowerShell\\V1.0\\powershell.exe"
53+
5254
const boshPsModules = "bosh-psmodules.zip"
5355
const winRMPsScript = "BOSH.WinRM.psm1"
5456

stembuild/construct/winrm.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ func (w *WinRMManager) Enable() error {
3535

3636
base64WinRM := EncodePowershellCommand(rawWinRMwtCmd)
3737

38-
pid, err := w.GuestManager.StartProgramInGuest(context.Background(), powershell, fmt.Sprintf("-EncodedCommand %s", base64WinRM))
38+
pid, err := w.GuestManager.StartProgramInGuest(context.Background(), powershellExePath, fmt.Sprintf("-EncodedCommand %s", base64WinRM))
3939
if err != nil {
4040
return fmt.Errorf(failureString, err)
4141
}

0 commit comments

Comments
 (0)