Hi,
Am trying to use the below command . The txt file is not created in the temp dir.
PowerCLI C:\> $scripttext=@'
>>
>>
>> set output_file=%TEMP%\ipconfig_output.txt
>>
>> ipconfig /all > %output_file%
>> '@
>>
PowerCLI C:\> Invoke-VMScript -VM $vm -ScriptType Bat -ScriptText $scripttext -GuestUser <Username> -GuestPassword <Password>
ScriptOutput
-------------------------------------------------------------------------------------------------------------------------------------------------------------------|
-------------------------------------------------------------------------------------------------------------------------------------------------------------------
When i use the filepath directly , this works and the txt file is created.
PowerCLI C:\> $scripttext=@'
>>
>> ipconfig /all > %TEMP%\ipconfig_output.txt
>> '@
>>
PowerCLI C:\> Invoke-VMScript -VM $vm -ScriptType Bat -ScriptText $scripttext -GuestUser <Username> -GuestPassword <Password>
ScriptOutput
-------------------------------------------------------------------------------------------------------------------------------------------------------------------|
-------------------------------------------------------------------------------------------------------------------------------------------------------------------
Note:
1. Am using PowerCLI 6.5 R1 to run these commands
2. The Guest VM has Windows 7 OS and VMware tools is installed and running.
My question is why is the set command not working ?
Thanks,
Arvind S