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

2
votes
1answer
1k views

Powershell Select-String to remove a string line from a variable if matched

I am trying to do the following: Look for a file in a folder which has been modified in the past 24 hours Find a specific section of the file Remove lines from the section matching specific ...
1
vote
0answers
417 views

Remote commands over SSH with Windows PowerShell - Protection against disconnection

I am planning to connect to remote Linux hosts via SSH and call scripts with Windows PowerShell SSH. As far as I understand, if the SSH connection is lost (timeout or connection reset) whilst the ...
1
vote
1answer
83 views

Counting files per owner

Using PowerShell how can I count the number of files that each owner has modified in the last 45 days? This is how I am able to get counts by extension in the last 45 days: gci -Recurse| where ...
0
votes
0answers
126 views

Tail for Powershell v3?

I'm running the following command in my powershell terminal: Get-Content C:\wamp\bin\apache\apache2.2.22\logs\lysol-dbau.access.log -Tail 10 -Wait So I want to start with the last 10 lines of the ...
3
votes
3answers
5k views

How can I copy a directory, overwriting its contents if it exists using Powershell?

I have a directory Source with some files in it, which I would like to copy to a folder Destination. Destination may exist, and it may have files in it already. Any files with the same name as those ...
0
votes
1answer
1k views

VPN in Powershell

I am updating an old DOS script which is used to open a Windows PPTP VPN connection between two server, copy some files, then close the connection. I am wanting to rewrite the script in powershell, so ...
1
vote
3answers
617 views

Powershell and SFTP.exe

Is it possible to pipe the contents of a folder on an SFTP site to a local file similar to window sinnate ftp.exe program where the syntax: dir /MainDir/SubDir c:\test\ftp\CurrentContents.txt but ...
2
votes
2answers
1k views

View DNS Suffix list

I am local administrator on my PC, but I cannot view my DNS Suffixes. I just want to be able to view them. Is there another way to see them? I am on Windows 7 64-bit Enterprise.
2
votes
3answers
15k views

Renaming computers via command prompt

I am the system admin for a small business (120 employees) and I am looking at an easy way to rename all of the computers in the office to a more uniform naming convention. I have tried playing with ...
0
votes
1answer
395 views

Delete partial matching lines from text file

I have 1 large xml file with lines like - <text file name 5 HD text> <text file name 2 text> <text file name 3 text> <text file name HD 2 text> <text file name 5 text> ...
1
vote
2answers
109 views

Methods to remove acronyms from a document?

I have a friend who wants to learn how to remove replace all acronyms with their proper names in reports she compiles. She showed me a list she has written out and it's enormous. I would think there ...
0
votes
0answers
83 views

scheduling various things and balancing bandwidth while using torrent and uploading

I have approximately 200 files to be downloaded via BitTorrent, these files can be from 200mb to 4.8 GB on the same time I want to take backup of some already existing pdfs in my home directory, ...
1
vote
0answers
268 views

Windows PowerShell doesn’t use my SSH keys

I have a Git repository hosted on Bitbucket. I can connect to this using Git Bash terminal, which uses my public key defined in my H: drive (network drive), but if I try the same from Windows ...
1
vote
2answers
204 views

How to change case of file in power shell

When I to run ren controller Controller in PowerShell I get this error message: ren : Source and destination path must be different. At line:1 char:1 + ren .\controller Controller + ...
22
votes
5answers
7k views

Cannot change powershell default font to Lucida Console

This is a trivial problem, but it annoys me that I can't get to the bottom of it: I'm running Windows 8, Powershell version 3.0. By right-clicking on the title bar I can go into the Properties and ...
0
votes
0answers
133 views

CLI(s) recognizing keyboard input much slower than typing speed

I've been living with this problem for quite a while now and I'm starting to get more and more frustrated as I work. In all of my command line interfaces on Windows 7 (powershell, cmd, git bash) ...
0
votes
2answers
234 views

Making the Windows Terminal Usable [duplicate]

Possible Duplicate: maximizing the windows Command prompt What I'd like is a way to make the command prompt and PowerShell a little more user friendly. Some basics of a good terminal or ...
0
votes
3answers
347 views

Is it possible to connect two Pc across the internet through VPN [duplicate]

Possible Duplicate: How to use Powershell Remote across the internet? My mom and I both have Windows 7 Professional. We are from different locations connected by Internet. We are both ...
0
votes
3answers
25k views

How to check internet browsing history through cmd or powershell on windows?

I would like to check a machine's internet browsing history and I would like to do this from the commandline or powershell. Is there any windows command for this or are there any tools for doing this ...
2
votes
1answer
344 views

How to use Powershell Remote across the internet?

I know that Powershell can be used on local network. But what if the computer that I want to manage is not on the same Lan as mine? We are each on a seperate LAN and both are behind a firewall. How ...
4
votes
1answer
8k views

PowerShell to remove built-in Windows 8 apps?

There are the PowerShell commands Get-AppxPackage and Remove-AppxPackage that allow you to remove Metro apps. However, they don't seem to show the built-in apps. I don't use Mail, People, Messaging, ...
0
votes
1answer
260 views

Grant full access to files on Windows Server 2008, only for a limited amount of time

I have a local Windows network with a Windows Server 2008 whose purpose is to act as a file server. I'm the administrator. I want to grant user full access to all the files on a certain directory ...
19
votes
2answers
2k views

Where does Windows 8 store the estimated data usage over Wifi?

I accidentally discovered that in Windows 8, if you right-click a previously connected wireless network from the Start screen interface, there's an option to show estimated data usage. Where's ...
1
vote
1answer
2k views

Powershell parameter set resolution with explicit parameter fails

Let's say I have this function : function Foo{ [CmdLetBinding()] param( [Parameter(Mandatory=$true,ParameterSetName="A",Position=0)] ...
0
votes
2answers
6k views

How to open Internet Explorer for the desktop from command line in Windows 8?

There are two different Internet Explorer versions in Windows 8. I would like to open Internet Explorer for the desktop from command line. We can run it via Win+R → iexplore, but I would like to run ...
0
votes
1answer
417 views

Delete all folders and files except for specified files?

Situation: I have multiple folders and files, which looks like this: C:\Users\myname\Desktop\project1\english\folder1\file1 C:\Users\myname\Desktop\project1\english\folder1\file2 ...
0
votes
1answer
265 views

How to switch between 2 ethernet NIC with Windows Powershell or coding in a Linux environment?

These are the linux routing commands I had used so far. #!/bin/sh # time checks in second SLEEPTIME=58 #IP Address or domain to test ping. TESTIP1=198.168.1.0 TESTIP2=198.168.1.1 #Ping timeout ...
3
votes
2answers
963 views

How to copy a file to all subfolders with specific name?

I have a file called SRED.txt and a folder which contains hundreds of subfolders. In each folder is another folder called SRED where this SRED.txt file should be saved. What I want to do is loop ...
1
vote
1answer
2k views

Running 'Start-Process' Remotely: How to Display Standard Output?

I have a PowerShell script for installing software on remote computers. To date I have been successfully using the following code: $prog = "ping" $arg = "localhost" $computername = "MACHINE01" ...
0
votes
1answer
338 views

Parse contig.exe output to *.csv using command-line or PowerShell

I am trying to parse the output file from contig.exe into a a comma-separated value file. I've developed a method to do this is Notepad++, but given the number of files I have to parse (hundreds of ...
1
vote
1answer
557 views

PowerShell - How do I define multiple commands in alias?

For example, if I type a command like this: Get-Childitem | where-object {$_lastwritetime.Day -eq "$data"} |sort-object lastwrittetime and I want to make an alias for it, I was trying do stuff ...
1
vote
3answers
923 views

Schedule a Powershell script in Windows 8?

How can I schedule a Powershell script to run every day at 3am in Windows 8?
1
vote
2answers
4k views

Search for a file with wildcards in the path using Windows command line

How can I search for files in the Windows command line, using wildcards like this? C:\Users\*\AppData\Local\*.txt
1
vote
2answers
839 views

How it happens that Powershell executed with “run” and with pinned icon has different settings?

On my Windows 7, if i run a powershell via "Win+R", "powershell" it will start with white text on black background and settings are affected via [HKEY_CURRENT_USER\Colors]. For example, i can easily ...
3
votes
2answers
473 views

What's the difference between Defaults and Properties when changing cmd.exe or PowerShell's settings? [duplicate]

Possible Duplicate: Temporarily Changing Console Properties in Windows 7 I want to change the font used by both cmd.exe and PowerShell. When I right click in the window border, I see both ...
1
vote
2answers
219 views

PowerShell get-help don't see synopsis and other things

I am running PS2.0 on Win8. When I run "get-help Get-ChildItem", I only see NAME and SYNTAX, where is the SYNOPSIS, RELATED LINKS and other info?
0
votes
1answer
1k views

How to programatically allow a Windows 8 app to run background tasks?

When you run a Windows 8 modern UI (previously called Metro) app that has background tasks, you must explicitly choose if it is allowed to run background tasks. Is there a way to automate this? I ...
1
vote
1answer
170 views

What was gpowershell.exe? Does it still exist?

I came across blog posts talking about gpowershell.exe (in Powershell 2.0 CTP) however, I didn't find any more recent information on what this tool is, whether it's included in later versions of ...
0
votes
1answer
370 views

Powershell multiple commands

Is it possible run two commands at once such as cd "C:/users/..." and Dir | -Rename-Item -NewName {...} I want to know if this is possible since it will drastic speed up what I am trying to do.
0
votes
4answers
371 views

windows cmd or powershell to search string in a file?

in a txt file I have this line: <em:version>0.0.0.2</em:version> Which cmd (dos or powershell) can I use fetch this? 0.0.0.2
4
votes
1answer
9k views

How to search and replace a string in a file with cmd or PowerShell?

I have a .txt file in which I want to replace the string aaa with bbb. I have tried the following PowerShell code: Get-Content c:\1.txt | ForEach-Object { $_ -replace "aaa", "bbb" } | Set-Content ...
1
vote
1answer
234 views

Active Directory 2008 R2, c#

I am using C# and trying to check if a group exists or not in active directory I am doing this string cmd = "New-Object DirectoryServices.DirectoryEntry \"LDAP://cn=" + groupname + " " + LdapDef + ...
1
vote
1answer
866 views

Open a custom remote powershell remotely

I have 2 computers. On the computer A, I have a custom module written in C# for powershell 3.0 and installed via a MSI. I also have a shortcut that open powershell with the module already loaded. I ...
3
votes
1answer
885 views

bash aliases equivalent for powershell?

By default my Windows PowerShell starts in C:\Users\Santosh, my XAMPP installation is in D:\ so the htdocs folder is located at D:\xampp\htdocs. If I have to edit something in htdocs folder then I ...
3
votes
2answers
3k views

Creating a folder named after the current date and time

I'm trying to create a powershell script that creates a new folder with the current date (formatted as yyyy-MM-dd) as a name. Here's what I have so far: PS C:\Users\me\Desktop> powershell.exe ...
0
votes
1answer
411 views

Add formatted text to Word autocorrect via PowerShell

We're using Word 2010 and have a PowerShell script that reads a table in a Word docx file and use it to populate the autocorrect dictionary. It works for the regular entries that don't require ...
0
votes
1answer
365 views

Powershell, Task Scheduler or loop and sleep

I have a job that needs to go off every minute or so, it loads a DLL i have written in C# that retrieves state for an SQL Server Mirror (Primary, Mirror and witness) for a number of databases; it ...
0
votes
0answers
403 views

how to speed up listing printers with powershell

When I use the following Powershell command to list all the printers my laptop has configured, it takes a few minutes for Windows to return the result. I have 3 printers configured, one is a virtual ...
5
votes
4answers
4k views

How can I delete a folder with “illegal” characters?

I plugged my USB flash memory stick into a Mac and it gained some unwanted hidden folders. (See the question Prevent MacOS from making .* and ._* files for prevention.) I'd now like to remove these ...
4
votes
2answers
5k views

Is Git Shell Windows Power Shell?

I have a simple question. What is Git Shell? IS it the same as Windows Power Shell? Because when I run Git Shell on my Windows 7 machine the Windows Power Shell is opened. Thanks for clarification. ...