Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The term 'c:/Windows/Temp/packer-ps-env-vars-[GUID].ps1' is not recognized as the name of a cmdlet #11013

Closed
johnypony3 opened this issue May 11, 2021 · 3 comments

Comments

@johnypony3
Copy link

Overview of the Issue

When building windows 2012/2016 (possibly others, but I'm not building them currently) the log contains the error in the title. This is a non critical error as the build completes.

Reproduction Steps

Standard build

Packer version

From 1.7.0

Simplified Packer Buildfile

https://gist.github.com/johnypony3/8886cbfa8c62056cc1e53bf47c0eebc7

Operating system and Environment details

RedHat 7 64bit
VMWare VMware Workstation 15.5.1 build-15018445

Log Fragments and crash.log files

�[0KRunning with gitlab-runner 12.1.0 (de7731dd)
�[0;m�[0K on rfds-builder 6pxscSV5
�[0;msection_start:1620758694:prepare_executor
�[0K�[0KUsing Shell executor...
�[0;msection_end:1620758694:prepare_executor
�[0Ksection_start:1620758694:prepare_script
�[0KRunning on y0319t12546...
section_end:1620758694:prepare_script
�[0Ksection_start:1620758694:get_sources
�[0K�[32;1mFetching changes with git depth set to 50...�[0;m
Reinitialized existing Git repository in /u01/builds/6pxscSV5/2/devx/golden-images/golden-ami-factory/.git/
�[32;1mChecking out 9e2da290 as ADOPT-2289...�[0;m
Removing build/
�[32;1mSkipping Git submodules setup�[0;m
section_end:1620758695:get_sources
�[0Ksection_start:1620758695:restore_cache
�[0Ksection_end:1620758695:restore_cache
�[0Ksection_start:1620758695:download_artifacts
�[0K�[32;1mDownloading artifacts for make_artifacts_dir (14193184)...�[0;m
Runtime platform �[0;m arch�[0;m=amd64 os�[0;m=linux pid�[0;m=106603 revision�[0;m=de7731dd version�[0;m=12.1.0
Downloading artifacts from coordinator... ok �[0;m id�[0;m=14193184 responseStatus�[0;m=200 OK token�[0;m=g3onVq5b
section_end:1620758696:download_artifacts
�[0Ksection_start:1620758696:build_script
�[0K�[32;1m$ if [ $CI_COMMIT_REF_NAME = 'master' ]; then export ENVIRONMENT=prod; fi;�[0;m
�[32;1m$ export CI_COMMIT_REF_NAME=${CI_COMMIT_REF_NAME,,}�[0;m
�[32;1m$ packer build -machine-readable -force -var-file=common/vsphere.variables.json -var-file=common/vsphere.${ENVIRONMENT}.variables.json -var-file=common/variables.json -var-file=$VAR_OS -var-file=$VAR_OS_VER -var "datetag=$(date +%Y%m%d%H%M%S)" -only=$RULE $TEMPLATE�[0;m
1620758697,,ui,say,Warning: Warning when preparing build: "vmware-iso"\n\nYour vmx data contains the following variable(s)%!(PACKER_COMMA) which Packer normally sets\nwhen it generates its own default vmx template. This may cause your build to\nfail or behave unpredictably: scsi0.virtualDev\n\n
1620758697,,ui,say,==> vmware-iso: Retrieving ISO
1620758697,,ui,say,==> vmware-iso: Trying https://[MASKED]:[MASKED]@artifactory.[MASKED].com/artifactory/generic-local/iso/os/windows/2016/WS2016-b14393.iso
1620758697,,ui,say,==> vmware-iso: Trying https://[MASKED]:[MASKED]@artifactory.[MASKED].com/artifactory/generic-local/iso/os/windows/2016/WS2016-b14393.iso?checksum=sha256%3A5a62abeb55e3a0f45189fa4b2c192be384956869b9e00b76963992234065b91a
1620758825,,ui,say,==> vmware-iso: https://[MASKED]:[MASKED]@artifactory.[MASKED].com/artifactory/generic-local/iso/os/windows/2016/WS2016-b14393.iso?checksum=sha256%3A5a62abeb55e3a0f45189fa4b2c192be384956869b9e00b76963992234065b91a => /u01/packer/packer_cache/c39bf4219846883ba39d1a9f3a7b74c8bea1e747.iso
1620758825,,ui,say,==> vmware-iso: Configuring output and export directories...
1620758825,,ui,say,==> vmware-iso: Creating floppy disk...
1620758825,,ui,message, vmware-iso: Copying files flatly from floppy_files
1620758825,,ui,message, vmware-iso: Copying file: packer/windows/2016_onprem/mount/Autounattend.xml
1620758825,,ui,message, vmware-iso: Copying file: packer/windows/scripts/Invoke-Defrag.ps1
1620758825,,ui,message, vmware-iso: Copying file: packer/windows/scripts/Remove-UpdateCache.ps1
1620758825,,ui,message, vmware-iso: Copying file: packer/windows/scripts/Reset-EmptySpace.ps1
1620758825,,ui,message, vmware-iso: Copying file: packer/windows/scripts/sysprep.ps1
1620758825,,ui,message, vmware-iso: Copying file: packer/windows/scripts/winrmConfig.bat
1620758825,,ui,message, vmware-iso: Copying directory: packer/windows/drivers/
1620758825,,ui,message, vmware-iso: Adding file: packer/windows/drivers/pvscsi.cat
1620758825,,ui,message, vmware-iso: Adding file: packer/windows/drivers/pvscsi.inf
1620758825,,ui,message, vmware-iso: Adding file: packer/windows/drivers/pvscsi.sys
1620758825,,ui,message, vmware-iso: Adding file: packer/windows/drivers/txtsetup.oem
1620758825,,ui,message, vmware-iso: Done copying files from floppy_files
1620758825,,ui,message, vmware-iso: Collecting paths from floppy_dirs
1620758825,,ui,message, vmware-iso: Resulting paths from floppy_dirs : []
1620758825,,ui,message, vmware-iso: Done copying paths from floppy_dirs
1620758825,,ui,say,==> vmware-iso: Creating required virtual machine disks
1620758826,,ui,say,==> vmware-iso: Building and writing VMX file
1620758826,,ui,say,==> vmware-iso: Starting virtual machine...
1620758826,,ui,message, vmware-iso: The VM will be run headless%!(PACKER_COMMA) without a GUI. If you want to\n vmware-iso: view the screen of the VM%!(PACKER_COMMA) connect via VNC with the password "wJI4Q3E0" to\n vmware-iso: vnc://0.0.0.0:5906
1620758827,,ui,say,==> vmware-iso: Connecting to VNC...
1620758827,,ui,say,==> vmware-iso: Waiting 5m0s for boot...
1620759127,,ui,say,==> vmware-iso: Typing the boot command over VNC...
1620759127,,ui,say,==> vmware-iso: Waiting for WinRM to become available...
1620759736,,ui,message, vmware-iso: WinRM connected.
1620759736,,ui,say,==> vmware-iso: Connected to WinRM!
1620759736,,ui,say,==> vmware-iso: Provisioning with Powershell...
1620759736,,ui,say,==> vmware-iso: Provisioning with powershell script: /u01/packer/packer_tmp/powershell-provisioner956887563
1620760129,,ui,message, vmware-iso: . : The term 'c:/Windows/Temp/packer-ps-env-vars-609ad0a9-ead9-ff96-1c10-f80ef5977d8e.ps1' is not recognized as the
1620760129,,ui,message, vmware-iso: name of a cmdlet%!(PACKER_COMMA) function%!(PACKER_COMMA) script file%!(PACKER_COMMA) or operable program. Check the spelling of the name%!(PACKER_COMMA) or if a path was
1620760129,,ui,message, vmware-iso: included%!(PACKER_COMMA) verify that the path is correct and try again.
1620760129,,ui,message, vmware-iso: At line:1 char:138
1620760129,,ui,message, vmware-iso: + ... ontinue'};. c:/Windows/Temp/packer-ps-env-vars-609ad0a9-ead9-ff96-1c1 ...
1620760129,,ui,message, vmware-iso: + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1620760129,,ui,message, vmware-iso: + CategoryInfo : ObjectNotFound: (c:/Windows/Temp...80ef5977d8e.ps1:String) []%!(PACKER_COMMA) CommandNotFoundException
1620760129,,ui,message, vmware-iso: + FullyQualifiedErrorId : CommandNotFoundException
1620760129,,ui,message, vmware-iso:
1620761964,,ui,message, vmware-iso:
1620761964,,ui,message, vmware-iso: Handles NPM(K) PM(K) WS(K) CPU(s) Id SI ProcessName
1620761964,,ui,message, vmware-iso: ------- ------ ----- ----- ------ -- -- -----------
1620761964,,ui,message, vmware-iso: 125 9 6288 7416 0.11 352 0 msiexec
1620762438,,ui,error,==> vmware-iso: . : The term 'c:/Windows/Temp/packer-ps-env-vars-609ad0a9-ead9-ff96-1c10-f80ef5977d8e.ps1' is not recognized as the
1620762438,,ui,error,==> vmware-iso: name of a cmdlet%!(PACKER_COMMA) function%!(PACKER_COMMA) script file%!(PACKER_COMMA) or operable program. Check the spelling of the name%!(PACKER_COMMA) or if a path was
1620762438,,ui,error,==> vmware-iso: included%!(PACKER_COMMA) verify that the path is correct and try again.
1620762438,,ui,error,==> vmware-iso: At line:1 char:138
1620762438,,ui,error,==> vmware-iso: + ... ontinue'};. c:/Windows/Temp/packer-ps-env-vars-609ad0a9-ead9-ff96-1c1 ...
1620762438,,ui,error,==> vmware-iso: + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1620762438,,ui,error,==> vmware-iso: + CategoryInfo : ObjectNotFound: (c:/Windows/Temp...80ef5977d8e.ps1:String) []%!(PACKER_COMMA) CommandNotFoundException
1620762438,,ui,error,==> vmware-iso: + FullyQualifiedErrorId : CommandNotFoundException

Thank you!

@sylviamoss
Copy link
Member

Hey there, thanks for reaching out. The build completes but does the created ISO work as expected?

@ghost
Copy link

ghost commented May 12, 2021

This issue has been automatically migrated to hashicorp/packer-plugin-vmware#22 because it looks like an issue with that plugin. If you believe this is not an issue with the plugin, please reply to hashicorp/packer-plugin-vmware#22.

@github-actions
Copy link

I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues.
If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jun 12, 2021
This issue was closed.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants