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

4
votes
1answer
3k views

Silent Java update check

How to have automatic Java updates without jusched.exe process running all the time in the background and with control when a check for the update should occur?
1
vote
2answers
16k views

How I can upgrade PowerShell on Windows Server 2008 R2?

I am using Windows PowerShell 1.0 in Windows Server 2008 R2. I have tried PowerShell 3.0 in Windows 8 and it looks good to me. Now the question is: How I can upgrade PowerShell on the Windows Server ...
0
votes
1answer
495 views

Running CCleaner with Psexec via Batch File

Is there a way to setup PSExec within a batch file to silently run CCleaner on remote PC's via a batch file scheduled in Task Scheduler? I understand CCleaner has an /AUTO switch on the command line, ...
5
votes
2answers
2k views

Command output as string

I want to get output from command C:\Program Files (x86)\Java\jre7\bin\java.exe" -version as string variable. I tried this way: $out = &"C:\Program Files (x86)\Java\jre7\bin\java.exe" -version ...
0
votes
0answers
405 views

Windows7: cmd/ps command to detect file/folder locks

Is there a command for cmd or powershell i can detect (and possibly delete) file/folder-locks. Something like net file? Edit: the Answer "no there is no such command" is eligible too.
0
votes
1answer
290 views

How do I use PowerShell 2?

I work primarily on a Windows 7 machine; sometimes on a Windows 2003 R2 server or a Windows 2008 R2 server. Its my understanding that Windows 7 and Windows 2008 both come with PowerShell 2, and maybe ...
9
votes
2answers
5k views

Run Python scripts in PowerShell directly

I'm using Windows PowerShell. Let's say I have a script called test.py that prints a few things. If I do: PS D:\>.\test.py then it opens a CMD window which prints a few things and then closes. ...
1
vote
1answer
490 views

Scheduling a Powershell script

I have a powershell script that I want to run as a schedule job. The script runs great when I execute it manually, but when I run the schedule task, the job fails with the message "could not start" ...
0
votes
2answers
3k views

Powershell Scripts to modify settings on Gpedit.msc console

Can any one of you please explain what is the exact powershell cmdlet for changing settings (Enabled or Disabled) in Gpedit.msc console...? I need a exact query to link (Computer ...
4
votes
1answer
93 views

Allow powershell script to run after marking it with “never run”

I ran Set-ExecutionPolicy to AllSigned, and when I try to run my script, on the prompt to trust the publisher, I accidentally entered V, to never run the script. How do I undo this, so that I can ...
0
votes
1answer
1k views

How to rename file with powershell and add alphabetic character to each file name?

currently i am rename my file with below command line i want to add alphabetic character to each file name like file-a.jpg file-b.jpg dir im* | ForEach-Object -begin { $count= 1 } -Process { ...
2
votes
1answer
3k views

How to Uninstall a windows service using Powershell Script?

I want to find and uninstall a windows service. how can I accomplish this using powrshell script?
0
votes
0answers
267 views

Powershell script to check service runing eg citrix port no 1438

Looking for powershell script which can give me the status of all my citrix server. Check for that port and then send that text file mail to all admins daily. Service running or service not running ...
0
votes
2answers
445 views

Underscore cursor vanishes when using arrow keys

In cmd and Powershell on my Vista machine, the underscore cursor blinks regularly. Pressing any key causes it to disappear for a moment, then resume blinking. For normal text entry, this is OK. But ...
2
votes
1answer
116 views

Ping-visible on unlock, ping-muted on screen lock

When I login to / unlock my Windows 7, I need to switch the machine to ping-responsiveness mode. When I pres Win-L key, i.e. lock the machine, I need it to ignore ICMP pings. How would I accomplish ...
9
votes
9answers
6k views

Is there a better, more UNIX-like command line shell for Windows?

I'm sure this has been asked before, but I haven't found it after an hour or so of searching... I've been using Unix and Mac OS for a while, but I'm a Windows user at heart. This #1 things that I've ...
4
votes
1answer
498 views

Powershell and cmd: “normal” select text mode

I find it quite infuriating how hard is to actually copy text in text only environments: Powershell and cmd. How can I simply select rows of text, not blocks of text? How did they came up up and think ...
0
votes
0answers
608 views

PowerShell script to Associate applications in Windows 8 (possibly employing ftype / assoc)

In Windows XP / Vista / 7, it was simple to re-associate items away from the defaults in bulk by using ftype and assoc as below. This was an important time-saver in system setup to make sure that all ...
5
votes
1answer
2k views

Can I customize the color scheme in PowerShell?

For example, I'd like blue to be a little bit lighter, or change red to be a bit more orangeish. Is this possible? I know that I can change the background and foreground colors easily. What about the ...
1
vote
2answers
737 views

How do I run a command with elevated permissions within a PowerShell/cmd.exe session?

In Linux, one can do su to become root (Administrator) for multiple commands, or sudo ... to run one command as root. Is there something similar in Windows, for either PowerShell or cmd.exe, that ...
1
vote
1answer
234 views

How can I create a Powershell script that can leverage the standard confirm switch?

Let's say I have a .ps1 with this content (the actual content does not matter) : param( [Parameter(Mandatory=$true)] [string] $someArgument ) # Do something risky Remove-Item ...
1
vote
1answer
1k views

How can I sort objects by third column in Powershell?

I've a text file like this: 4108689096 2531 ./ssss/132432.odt 481446057 2293 ./abc/a.txt 3157353085 1096 ./dsjvbjf/c.docx 653380669 1824 ./bcd/x.avi And I'd like to achieve in Powershell to sort ...
7
votes
2answers
3k views

Why does Powershell silently convert a string array with one item to a string

Consider the following Powershell script, which searches for folders in C:\ with a 'og' in their name: PS C:\> (ls | %{$_.Name} | ?{$_.Contains("og")}) PerfLogs Program Files setup.log Now I ...
3
votes
2answers
658 views

Get definition of function and echo the code

I've defined a dynamic function in powershell, like this: > function test { dir -r -fil *.vbproj | ft directory, name } Then I can just type test and run that function, piping it to other ...
0
votes
2answers
819 views

Not able to run powershell script from autosys

I am new to powershell and using 1.0version and am trying to write a powershell script that I can execute using autosys scheduler. When the I run the command in autosys powershell -command "& { ...
4
votes
2answers
2k views

How to quickly save what is currently shown in cmd.exe to a file

I am asking if there is a quick way/command to save the current standard output from cmd.exe or powershell to a file. For example, I have run a bunch of commands in cmd.exe which generating like ...
0
votes
2answers
1k views

How do I cd to a symlink in PowerShell?

I've created a symbolic link like so: PS C:\dev\bin> cmd /c mklink "wd" c:\dev\code symbolic link created for wd <<===>> c:\dev\code OK, simple. So then I try to cd to it: PS ...
1
vote
1answer
79 views

how can I make a sym link that is available anywhere (via command line) in Windows 7?

In Ubuntu I've been using: cd ~/theApp to get to a frequently used directory. Is there a Windows equivalent? I'm looking for a sym link (via mklink) that is available no matter where I am. Would ...
1
vote
1answer
254 views

PowerShell prompt here

I'm using this small script from here to append an entry to opening PowerShell from the context menu when clicking on a folder. However, I'd like to change its behaviour in order to open the ...
10
votes
2answers
4k views

tmux/screen alternative for powershell

Is there an alternative to tmux/screen that would work on Windows with Powershell? I'm aware of Powerscreen, but it seems dead for a long time. Cygwin wouldn't work with Powershell, would it? Console2 ...
1
vote
0answers
220 views

How do I add fileversion to an object containing a number of filenames?

I have loooked for an answer to this question, but cannot find out how to add into an object creating a data-set pair of file name and version, and the related original wsp or cab filename. I have a ...
1
vote
1answer
746 views

Loop through several servers, find specific dlls , get the dll version, internal filename and path?

I am new to Powershell, and using PS v2. I can see the massive potential it has, but I just can't get the following code to work fully. I am trying to end up with a csv file that contains the wild ...
8
votes
2answers
6k views

Programatically associate file extensions with application on Windows

I've just recently reinstalled Windows and in setting up my environment I've noticed that all my associations for the various programming languages I edit in Notepad++ have gone (naturally). I am ...
0
votes
2answers
538 views

can I get powershell to properly copy multiline text like Bash in Ubuntu does?

I use an Ubuntu VM at home for Rails development and I've gotten a bit spoiled by Bash. When I copy multiline text from Bash, it seems like it's pretty good about knowing that text is single line or ...
2
votes
1answer
2k views

is there equivalent of rsync in MS powershell?

Rsync is very useful, I don't have to copy all files in a directory. It updates only the newer files. I use it with cygwin but I think there are some inconsistencies, which are not the main focus of ...
16
votes
4answers
20k views

Copy and paste in Windows PowerShell

How do I effectively copy and paste input and output in the Windows PowerShell?
0
votes
2answers
953 views

How do I run “dir pattern /s /b” in powershell?

I want to achieve the same output in Powershell as I would get by running dir [pattern] /s /b in cmd.exe. Recursive directory search, with a filter, printing out just the full file paths of found ...
1
vote
2answers
2k views

Powershell - save output to file without “…”

I have properties in my SharePoint web application, and I'd like to save them to text file. After calling $webApplication.Properties, I can see something like this: Name ...
7
votes
5answers
14k views

How to rename multiple files in multiple folders with 1 command

We want to rename our *.html files to *.php but (sadly enough) have not enough knowledge to do it with a dos batchfile and/or cmd prompt command. The problem is that each file is in seperat folder ...
1
vote
1answer
1k views

How do obtain additional process information in PowerShell?

In powershell, if I do 'get-process', I get PS C:\Documents and Settings\Hello\Desktop> get-process -name excel Handles NPM(K) PM(K) WS(K) VM(M) CPU(s) Id ProcessName ------- ...
1
vote
1answer
799 views

How to run script as administrator?

I'm looking to do what's asked in this question: how to run a powershell script as administrator The accepted answer says to use a shortcut. I'd like to do that, but when I get into Advanced ...
1
vote
1answer
336 views

Two PowerShell commands together?

How can I execute two PowerShell commands such that I only send text to the prompt once and the second command executes only after the first command has executed successfully?
2
votes
1answer
2k views

What permission is needed to enable PowerShell Remoting?

I am trying to enable PowerShell Remoting on my desktop where I am an Administrator. I have setup Powershell Remoting on my laptop and it works (going from my laptop to a remote server). On my ...
0
votes
2answers
762 views

Passing a powershell variable as output directory in 7zip

I need to execute something like 7za e $file_path -oC:\Destination inside a powershell script, but substitute destination folder (C:\Destination) with a variable. Some like: 7za e $file_path ...
3
votes
3answers
3k views

How to use powershell to search registry?

I am totally new to Powershell. Just started to pick up yesterday. When I found that resource 'Learn Powershell before it is emergence', I realised how apt is the title. Powershell has already ...
0
votes
1answer
395 views

How to install VirtualCloneDrive silently with PowerShell

.\SetupVirtualCloneDrive5450.exe /S I wrote this command. Then, Windows Security popup came on screen. It asked me "install?" or "don't install?" How can i install this programme silently with ...
1
vote
3answers
4k views

Change directory in batch file with PowerShell

I need to changed directory using batch file in PowerShell. Let's say the batch file named go.bat has the two lines of code. And I'm in q: directory. c: cd c:\abc\def When I run go.bat, I'm ...
3
votes
2answers
3k views

Convert text files recursively to UTF-8 in PowerShell

I have a folder with text files which includes other folders in it, and these also contain some text files. I need to recursively convert all these files to UTF-8 encoding in PowerShell and preserve ...
1
vote
1answer
562 views

Msbuild does not recognize mapped network drive

We have a project that builds and has a post build event. The post build event copies the output DLL to a directory F. The system is supposed to place all DLLs in the F drive. In my system, I cannot ...
1
vote
3answers
2k views

Is there a way to start or stop a service from powershell and block until the service starts?

I have to reset a sequence of services on a group of servers in a certain order. sc.exe is asynchronous, it will return when the service is in the START_PENDING or STOP_PENDING state. ...