Description of Windows PowerShell 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. The ...
0
votes
1answer
49 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 { ...
0
votes
0answers
13 views
PowerShell interpret linux terminal signals
I'm an admin using a Win7 desktop and I manage linux servers, many times editing scripts on the linux machines with terminal based editors like nano and vim, plus I do also do a great deal of GPU ...
1
vote
1answer
54 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
36 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
27 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 ...
1
vote
0answers
36 views
Ping-visible on unlock, ping-muted on screen lock (Win7)
When I login to / unlock my Win7, 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 to accomplish this?
1
vote
2answers
182 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 ...
3
votes
1answer
78 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
27 views
In a Powershell module, how can I resolve caller relative path?
I have a PowerShell module (deployed in the shared modules directory) that provides a function, in which a directory should be created (for example) :
function Process-Something
{
param(
...
0
votes
0answers
102 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 ...
2
votes
1answer
82 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
86 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
42 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
152 views
Powershell Sort-Object by 3rd Column
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 ...
4
votes
2answers
132 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 ...
2
votes
2answers
49 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
117 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 "& { ...
3
votes
2answers
126 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
65 views
how do I cd to a symlink in powershell?
Seems like a simple question, but the first 3 pages of google results didn't have an answer. I've created a symlink like so:
PS C:\dev\bin> cmd /c mklink "wd" c:\dev\code
symbolic link created ...
1
vote
1answer
44 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
0answers
59 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 ...
3
votes
2answers
135 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
53 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
112 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 ...
2
votes
2answers
180 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
87 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 ...
1
vote
1answer
132 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 ...
2
votes
3answers
152 views
Copy and paste in Windows PowerShell
How do I effectively copy and paste input and output in the Windows PowerShell?
0
votes
2answers
47 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
127 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 ...
2
votes
4answers
351 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
68 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
------- ...
0
votes
0answers
16 views
Script to running an application when I´m connected to fixed network
I like to run skype at startup only when I´m connected to my work network by SSDI. I think it´s possible.
Thx in advance,
1
vote
1answer
155 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 ...
0
votes
1answer
58 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?
1
vote
1answer
82 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
162 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 ...
2
votes
3answers
184 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
0answers
105 views
download Email Attachements with Powershell from Exchange Server
I am writing a powershell script that will be run weekly to go to a particular mailbox on our exchange server. Its job is to find the latest email and download its Attachment. I have been all over the ...
0
votes
1answer
101 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 ...
0
votes
3answers
302 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 ...
2
votes
1answer
182 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
190 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 ...
0
votes
0answers
70 views
Using HTTPS client certificates with BITS in PowerShell
I've got an Apache webserver which is configured to only allow clients to connect if they present a valid SSL/TLS client certificate.
I'd now like to be able to get BITS in Windows PowerShell to ...
0
votes
2answers
135 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. ...
0
votes
0answers
39 views
How do I identify sharing permissions on a file?
In my home network all my computers are in a single homegroup. When I share a folder with the sharing context menu shown below, if I use Windows Explorer the status bar at the bottom of the window ...
1
vote
2answers
225 views
How do I set an executable's working directory via the command line, prior to executing it?
If I run a program on the command line whose location is resolved through the Path environment variable, the program's working directory is generally set to its installation directory.
I would like ...
1
vote
1answer
99 views
How to add a string to remote file with plink
I'm writing a new backup script in [Powershell][1] to backup our [Azure SQL][2].
After the backup, I need to write into a logfile on a remote linux server.
I thought about using plink (the ...
3
votes
1answer
75 views
Updating the last write time for a symbolic link in Windows
Is it possible to update the last write time for a symbolic link in Windows? I can use the following powershell command to update the last write time of a directory, but it doesn't work for a ...
0
votes
2answers
65 views
How do you run an executable with the same name as an alias in powershell?
sc.exe is a command line tool for manipulating services on windows. E.g. to list all the services on your machine you can type sc query from a command prompt. However, if you do it from powershell, it ...