VMware Cloud Community
ganapa2000
Hot Shot
Hot Shot

Error : Application location is untrusted. Copy file to a local drive, and try again

Hi All,

I am getting the below error when I run the script

script : get-process | Write-Output *>&1 | tee ".\Disk_Extend_Log_$date.txt" | out-host

Error : Application location is untrusted. Copy file to a local drive, and try again

I would like to get output both to console and output to file

Reply
0 Kudos
3 Replies
LucD
Leadership
Leadership

Seems to be working for me (PS v5.1, PowerCLI 10.1.0 on Win10).

Which versions and platform are you using?


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference

Reply
0 Kudos
LucD
Leadership
Leadership

On further testing, looks like this might be a UAC issue.

See https://support.microsoft.com/en-us/help/2019185/copying-files-from-a-mapped-drive-to-a-local-direct...


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference

Reply
0 Kudos
ganapa2000
Hot Shot
Hot Shot

Thank you very much for your assistance.

I think, i figured out the issue was caused because of variable defined

$date = Get-Date -format dd-MMM-yyyy_HH:mm:ss_tt

after changing the variable to

$Today = Get-Date -format dd-MMM-yyyy-HH-mm-ss-tt

It worked. Not sure, what caused error

Reply
0 Kudos