Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Running Windows 7 Ultimate x64

I am running Windows Firewall in an include only fashion (only programs I explicitly allow can access the internet).

I'm having trouble getting Powershell the ability to access the internet.

UPDATE: Example of What I am doing:

$wc = new-object system.net.webclient;
$wc.DownloadString("http://www.superuser.com") > html.txt

I've allowed the executable at both SysWow64 and in Windows\System32 with no such luck. Is there a service I need to allow?

share|improve this question
    
What is it you are trying to do? If PowerShell is triggering other programs (even seemingly innocuous ones) I think it is those programs, and not PowerShell, that will need firewall permissions. –  DMA57361 Sep 15 '10 at 8:06
    
See the Update to my original post. –  Matthew Sep 15 '10 at 14:01

1 Answer 1

Powershell.exe is the process doing the work (that is, your code here doesn't spawn any child processes) so I'm not sure what your problem might be. I'm also assuming if you disable the firewall you have no problems at all.

I would get SysInternals' ProcMon and use it to monitor Powershell.exe when you execute the second line of code in your example there. Look for whatever operation is getting an access denied error. That should give you a clue about what's going on.

I would also try using $downloadString = $wc.DownloadString("http://www.superuser.com") just so you can eliminate any possibility that your output file is where the problem is.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.