Windows PowerShell is a command line shell and scripting language for Windows that supersedes the CMD.exe shell and batch language. PowerShell is also an automation engine for Windows that provides functionality similar to Windows Script Host and VBScript.

learn more… | top users | synonyms

0
votes
2answers
2k views

Search for text in web pages given a list of URLs

I have a list of several thousand URLs, and I'd like to search each of these pages for a given word. How can I do this programmatically on Windows, preferably using VBScript or Powershell?
6
votes
1answer
3k views

List sub-folders at a certain level, with modified dates

Challenge for you guys, here: I need some method (preferably built-in, but F/OSS third-party apps may also be considered) to generate a list of sub-folders, at a certain level, along with (or, ...
2
votes
1answer
1k views

Set paper size of Zebra TLP 2844 programmatically

I have a lot of Zebra TLP 2844 printers used by domain users. Unluckily by default the paper size is 2" x 4" while I need to have 4" x 3". The first time each user logs on I have to change manually ...
1
vote
2answers
500 views

Powershell queries

Is there a command line bash's !$ (match last word of previous command) any shortcut to delete previous word. Ex: cd D:\programs\scrap .<ctrl+backspace> deletes the word 'scrap' Replace ...
2
votes
2answers
6k views

Running a powershell script using a batch file (.bat)

Currently this is my path for launching VMware vSphere PowerCLI command prompt. I wish to run my sample.ps1 script automatically using a batch file. How can I incoporate sample.ps1 into this path and ...
5
votes
7answers
26k views

How can I permanently assign drive letters to my USB devices in Windows?

I have several customers with different PCs (Windows XP, Windows Vista and Windows 7). Unlike DOS 6.22, where you can permanently assign drive letter designations (e.g. Drive C: = Hard Disk Bootable ...
1
vote
1answer
562 views

Setting alias in Windows PowerShell

In PowerShell, I type: PS C:> sal cdp "cd 'C:\Users\ec\Documents\Visual Studio 2010\Projects'" I get no error from this, and PS C:> gal cdp shows definition as: cd 'C:\Users\ec\Documents\Visual ...
7
votes
3answers
9k views

Where can I download Powershell 2.0 for Windows 7?

I have spent the better part of a day hunting the Internet looking forr a way to download Powershell 2.0 to my already Win7 environment. Windows 7 is supposed to come with PS 2.0 however - I have 1.0. ...
3
votes
1answer
1k views

Powershell background tasks

how do I do a background task in Powershell? $ ant >/dev/null & #cygwin The closest I can get to this in Powershell is ps2> start-job {ant |out-null; `a} #powershell but then ...
3
votes
2answers
470 views

Identify ENCRYPTED compressed files at the command line

I have directories with hundreds of RAR files. Currently I use Powershell 2.0 with a script that utilizes WinRAR's RAR utility to decompress the files. The issue is that a small number of the files ...
35
votes
5answers
33k views

How to copy text from PowerShell

Sometimes I want to copy a command from Powershell to paste in a document, or I want to copy the output? How can I select and copy text in Powershell? At least I know a way how to paste a text (or a ...
1
vote
4answers
6k views

Converting Visio (.vsd) files to PDF automatically

I am trying to create a scheduled task to convert all my .vsd files to PDF format so all of our devices can read them (Linux, Mac, smartphones, etc.), and I would prefer not paying for something that ...
4
votes
2answers
422 views

Non-alphanumeric character folder name auto-completion problems

I have been working with Windows 7's command line and have some folders that begin with non-alphanumeric characters. When I try to use tab completion to complete the folder name, the initial character ...
3
votes
1answer
579 views

How to stream IPConfig /displaydns

Is there a simple way I can have a powershell / cmd prompt open and stream the dns cache so that it will scroll automatically as things are being cached?
4
votes
3answers
2k views

Powershell vs. vbs vs. bat

I need to configure few Windows 7 machines (with a wide variety of tasks - from setting up screensaver, disabling services, adding task schedule entries to setting up IPsec/firewall rules). Since ...
9
votes
4answers
9k views

Windows PowerShell equivalent to Unix/Linux `pwd`?

In follow-up to the cmd.exe question, what is the PowerShell equivalent to echo %cd%, or Linux/Unix pwd?
1
vote
1answer
7k views

How to fix this WinRM error? (Set-WSManQuickConfig error)

On Windows XP Pro SP3, when I run Set-WSManQuickConfig (after agreeing to the new settings), I get this error: Set-WSManQuickConfig : <f:WSManFault ...
3
votes
3answers
4k views

Scheduled Tasks Properties in PowerShell?

I am not sure how to do this in PowerShell, but I dont think it is supported. For example: $tasks = schtasks /query Will store all the tasks into the variable $tasks Example output: Folder: ...
0
votes
1answer
842 views

Modify Task Scheduler with PowerShell

How does one go about modifying task scheduler via powershell?
7
votes
2answers
6k views

PowerShell zip file synchronously

In a PowerShell script, I want to zip a folder before deleting the folder. I run the following (I don't remember where I found the snippet): function Compress-ToZip { param([string]$zipfilename) ...
3
votes
1answer
2k views

Schedule powershell script with admin priviliges

I want to schedule a powershell script to run on my windows 7 system everyday with admin priviliges. How do I do so?
8
votes
2answers
5k views

Can I set PowerShell as 'default' in Windows 7?

I would like, by default, for PowerShell to be launched instead of Command when, say, running a batch file, or when I "Open Command Window Here", etc. Any suggestions?
1
vote
1answer
1k views

Basic Auth & Internet Explorer Automation in Powershell

I'm in the need of automating an administration task of a web application. I used Powershell and the InternetExplorer.Application ComObject to accomplish this task. The relevant part is to navigate to ...
9
votes
2answers
2k views

How to open a PowerShell in the current folder?

This keyboard shortcut Shift + Menu, W, Enter opens the command prompt. Scott Hanselman points to an app that does the same for PowerShell and says it's builtin in Windows 7. The tool doesn't seem to ...
0
votes
3answers
1k views

Script to kill multiple process with same session using scripts

How can I kill a process running with in multiple sessions using a bash or powershell script?
3
votes
2answers
1k views

Possible to setup “tab completion” for parameters in a custom PowerShell script?

I did a bit of looking around but haven't seen a way to do this. Could I implement this through my script or would it have to be done somewhere else? I would need users to be able to tab through the ...
1
vote
2answers
2k views

Using powershell to manage Active Directory running on Windows Server 2003?

I would like to create a script that can use the ActiveDirectory module in powershell (from a remote machine). From what I understand I need to have Active Directory Web Services (ADWS) installed for ...
3
votes
4answers
3k views

launch powershell script from registry

I have a powershell script that I want to run on my PC every time I log on. I've added it as a REG_SZ in my current user "run" key, but it never executes. I've altered the execution policy to ...
4
votes
4answers
2k views

Loading managed Windows PowerShell failed with error 80070002

I get an error when I try to run PowerShell: Internal Windows PowerShell error. Loading managed Windows PowerShell failed with error 80070002. I am running Windows 7 Home Premium (64-bit). This ...
1
vote
2answers
2k views

running PowerShell's Invoke-Item with a switch

I'm trying to make a PowerShell script to launch programs after I boot up my machine. I'm taking things out of the registry's "run" area and putting them in the script in the order that I want and ...
2
votes
1answer
2k views

powershell import-csv mangles diacritical characters

I am trying to create users in AD (2003 server R2) from a CSVfile using PowerShell (v2) when I use import-csv the resulting data gets mangled when names have diacritical characters in them. Jerónimo ...
3
votes
1answer
4k views

Powershell Start-Process Parameter Problems

Probably a total noob question but: When I run Start-Process ".\packages\PS-Get.0.1.0.0\NuGet.exe" update -RedirectStandardOutput ".\packages\PS-Get.0.1.0.0\NuGet.exe.Update.log" ...
7
votes
4answers
14k views

Is Windows PowerShell 2.0 installed by default on Windows 7?

http://msdn.microsoft.com/en-us/library/ff637750.aspx claims Windows PowerShell 2.0 needs to be installed on Windows Server 2008 and Windows Vista only. It is already installed on Windows Server ...
6
votes
1answer
2k views

PowerShell Tee questions

I use this command to see output both on console and file: powershell -command "my_command_1 | tee ('logs\{0}.log' -f (Get-Date -format 'yyyy.MM.dd-HH.mm'))" powershell -command "my_command_2 | tee ...
2
votes
3answers
2k views

Windows 7 SP1 x64 Occasional Powershell Error Message- There is no disk in the drive

Every once in a while when I launch powershell on my Windows 7 SP1 x64 machine I get this error. None of the buttons will get rid of the error, it just comes back, I have to close the broken ...
2
votes
2answers
934 views

Disable Dropbox when WiFi isn't available

I have an ultralight PC with Windows 7 that I use during my daily bus commute. Since the processor speed is limited, I'm looking for a way to disable/enable Dropbox when I'm not connected to a WiFi ...
0
votes
1answer
217 views

How do I disable paging of help in PowerShell?

By default, when you use help in PowerShell, the output is paged using more. If you install PSCX, it gives you the option of using less instead. By default, I'd rather use neither (I have a ...
3
votes
2answers
4k views

grep in Powershell

What is the mos easy/comfortable way to use Powershells built-in functions to emulate grep like behaviour? In scripts I use something like this dir "*.filter" | foreach-object{ $actfile = $_ ...
2
votes
2answers
853 views

powershell or cmd for remote administration

i frequently use remote desktop, gotoassist express and logmein to administer servers or end user terminals. in certain circumstances there is significant latency or low bandwidth where a full ...
1
vote
3answers
365 views

PowerShell - environment vars - differentiating between user and system vars

How can I display environment variables in PowerShell, and be able to distinguish between which ones are "user" vars and which ones are "system" vars?
2
votes
3answers
1k views

Running Windows Powershell Scripts simply opens it in the editor

I have a Windows powershell script that works fine in the interactive editor. The script is a simple one line sql cmd: sqlcmd -S servername -d dbname -E -W -w 999 -s "," -Q "SELECT select ...
12
votes
2answers
2k views

Set Powershell as the default shell of Far Manager?

Can I set Powershell as the default shell of Far Manager?
3
votes
1answer
18k views

Change NIC speed/duplex settings in script?

I have a laptop running Windows Server 2003 SP2, with PowerShell installed. Occasionally, this system has to be used in environments where it needs the NIC manually set to 100 Mbps/Full Duplex in ...
2
votes
1answer
1k views

How do I detect if a file is locked with powershell

How do I detect if a file has been locked by another process in powershell? I have read some examples of checks that catches the exception that occurs when trying to read the file. This some how does ...
1
vote
1answer
880 views

Why would Windows PowerShell slow startup? [closed]

After installing the program my start up time increased by about 30 seconds. Any ideas why?
2
votes
1answer
957 views

Can I use a multi-line function or control flow segment into the PowerShellFar editor console

If I am running farmanager with FarNet and PowerShellFar I can bring up a console of sorts by selecting F11 | .NET PowerShell | Editor Console. This console is based on the far editor. I can paste ...
1
vote
1answer
855 views

Help with batch file to start Powershell in specific directory & retain settings

I'm running Win7 and have Powershell docked on my taskbar. When I launch it from there, it retains all of my color and font settings from the last time I used it. I have two questions. First, if I ...
4
votes
1answer
547 views

How can I run PowerShell commands without enclosing arguments in quotes?

When I try to run a program with a command line option from the PowerShell prompt, PowerShell ends up mangling the option. Why does this happen? Is there any way to stop it besides enclosing the ...
0
votes
1answer
467 views

how to get multiple network names using get-networkadapter CMDLET?

Am new to Powershell. I need to get names of all network using get-networkadapter cmdlet. Can anyone please help me out?
1
vote
2answers
2k views

Deactivate Wlan Adapter via Powershell

I want to deactivate and then activate my wlan adapter via powershell. I already queried the Hardware-ID of the device. My script looks like this: $wireless = Get-WmiObject win32_networkadapter | ...