0
Im a standard user without admin privileges on my windows 7 box. I wrote a powershell script that doesn't require admin privileges (it downloads data from yahoo finance and saves it as a CSV file):
$client = New-Object System.Net.WebClient
$yf_url = "http://download.finance.yahoo.com/d/quotes.csv?s=EDV,BND&f=sl1d1t1c1ohgv&e=.csv"
$yf_file = "prices.csv"
$client.DownloadFile($yf_url, $yf_file)
From Get-ExecutionPolicy
I know that the security policy on my system is set to Restricted
(the default), but Im wondering if there is a way to run this script without having admin privileges.
If I write a powershell script locally that doesnt require admin privileges, is there a way to set the execution policy so I can run it, without having to elevate myself to admin (which I cant do because its a work computer)?
when i runt he script with Invoke-Expression get_prices.ps1
in the folder D:\myfiles
(D: is a second hard drive) I get the error message:
File D:\myfiles\get_prices.ps1 cannot be loaded because the execution of scripts is disabled on your system
what folder are you downloading to? you should be able to execute a script as a normal user if that script doesn't do anything that requires admin. do you have full control of the destination directory? – Frank Thomas – 2014-06-04T16:03:00.807
@FrankThomas yes I do. I'm downloading to the local folder which right now is simply
D:\myfiles\prices.csv
(D: is a second hard drive). I added part of the error message (cant copy/paste from powershell but ill type the rest in in a bit) – Michael A – 2014-06-04T16:03:45.777