powershell - Powershell_script resource throws error: "Your session has expired, please login again." -


i trying use chef pull file perforce, calling p4 sync powershell script. title indicates, being plagued failure: "your session has expired, please login again." have gathered, has way powershell script run through chef (using invoke-command?)

here's have not working :(

powershell_script 'p4sync'     cwd "c:\\program files\\perforce"     code <<-eoh         &".\\p4.exe" set p4port=server:1234         &".\\p4.exe" set p4user=automation_user         set shallnotpass 'automation_user_password_ticket'         &".\\p4.exe" -d c:\\temp -p $shallnotpass client -o | &".\\p4.exe" -p $shallnotpass client -i         set  rootdir '//root/scripts'         &".\\p4.exe" -p $shallnotpass sync $rootdir/script.bat         &".\\p4.exe" -p $shallnotpass sync $rootdir/script.sh     eoh end 

the other powershell_script resources have used (which are working) involve powershell cmdlets, , not external executables.

any suggestions appreciated! also, if care share other resources might have found information on own, helpful. i've spent quite bit of time hunting internet on error, , haven't had luck.

the error message perforce authentication failure , suggests there's problem automation_user_password_ticket. if that's ticket (it should hash rather plaintext), problem it's expired -- default login ticket valid 12 hours after "p4 login" command used acquire it.

see documentation "p4 login" more on how tickets work:

http://www.perforce.com/perforce/r15.1/manuals/cmdref/p4_login.html

the easiest solution put automation_user in group unlimited timeout, re-run "p4 login" new ticket (which never expire) , put in script.