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

3
votes
1answer
1k views

Get CPU for process in powershell

I want to get the value that is shown in task manager for any process in the CPU column in powershell. I tried using Get-Process ProcessName | Select-Object -Property CPU but it only returns the ...
3
votes
1answer
580 views

Powershell systemroot in $env:path different when AC elevated

I have a strange behavior with the environment variables at my Windows XP SP3. When I logon as Administrator, the %SystemRoot% strings in PATH are substituted to C:\WINDOWS, the value of the variable ...
3
votes
1answer
5k views

What is the Start Screen Control in Windows 8.1 Enterprise

I have read different things on the new Windows 8.1 Enterprise RTM. One of the feature is the Start Screen Control. Start Screen Control: This feature allows you to control the look of the Start ...
3
votes
1answer
608 views

Detect mounting of a virtual (TrueCrypt) volume in windows PowerShell script

I am using the following powershell script to detect when a particular volume is mounted so I can run a script that will move files from my machine to the device (I don't know much about powershell ...
3
votes
1answer
241 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 ...
2
votes
1answer
69 views

Copy based on last modified date of files

I want to copy from below source dir to the desired destination as shown below. Source dir: --Dummy ----dirA (contain files last modified 2/7/2015) ----dirB (contain files last modified 3/7/2015) ...
2
votes
1answer
2k views

Get Network Printers From A Remote Computer

I am using this to attempt to get a list of printers on a remote computer: Get-WmiObject win32_printer -ComputerName "$oldPcName" The problem is I only get local printers, not those printers from ...
2
votes
1answer
192 views

How to remove substring in Powershell script

This script is almost what I need: $input_path = 'C:\Common' $output_file = 'C:\Common\extracted.txt' $regex = 'assets' Get-ChildItem -Path $input_path -Filter *.txt | Select-String -Pattern $regex ...
2
votes
1answer
143 views

How to change date format in multiple text files in powershell?

Hello I have around 5000 text files (TXT) in one directory.Files are comma delimited. What I'm trying to do is to change date format (it is stored in first column of each file) from M/d/yyyy to ...
2
votes
1answer
251 views

How do version differences affect PowerShell commands on remote computers?

Newer PowerShell versions obviously will come with new features and new cmdlets. This is something which is important to take into consideration when writing scripts, or PowerShell walkthroughs, which ...
2
votes
1answer
743 views

batch script to “scan for hardware” in Windows 8.1

There is this issue with Wifi on the Surface Pro 3 that can be easily fixed with a script that does the equivalent of running "Scan for hardware changes" in the Device Manager. This script will be ...
2
votes
1answer
81 views

“Help Tree” returns help for Copy-Item

In doing some research on another question, I wanted to check to be sure that tree was not an actual native PowerShell command or alias. Of course, the proper way to do this is with Get-Command. ...
2
votes
1answer
64 views

What is the powershell equivalent for `pwd -P`?

I have made a symlink using cmd /c mklink /D "MyDir" C:\MyDir in my home directory C:\Users\myusername. When I type cd toDir from my homedir and type pwd it returns Path ---- C:\Users\myusername\My ...
2
votes
1answer
919 views

Troubles running Azure powershell

I'm trying to install Azure Powershell, following the instructions on this page. The installation seems to run fine and proceeds without errors. However, once it's finished, I can't manage to find ...
2
votes
1answer
690 views

need command line to test duplex status on windows NIC cards

this woud be for windows 7 I tried the following powershell command get-wmiobject Win32_NetworkAdapter | foreach-object { get-wmiobject -namespace root/WMI -class MSNdis_macOptions -filter ...
2
votes
1answer
230 views

GIT via OpenSSH in Powershell is fine, so why can't I connect in plain cmd console?

when I run ssh user@servername01 ...under powershell it connects without a problem, however when I run the same command under a standard cmd prompt I am prompted for a password (no password is set ...
2
votes
1answer
226 views

Powershell - Elevation Loses Current Directory

One problem leads to another! User help just fixed one issue, which led to another as I continued working on this script. My script runs a check to see if the current user is an Administrator as ...
2
votes
1answer
110 views

Powershell commands for modifying files if accessed times is within a time window

I'm trying to learn Windows powershell and in particular, would like to write a script to operate on all files within a folder (including subdirectories). The script will examine each file and if the ...
2
votes
1answer
491 views

Making PowerShell assume the working directory of a called Batch file

I regularly work interactively with a batch script that I can't easily change. One of the features of this script is as a navigation aid - it understands my company/product's code layout conventions ...
2
votes
1answer
552 views

How to lock Powershell ISE console output scroll?

I'm using Powershell ISE for running some batch scripts. The outputs will be long and these programs will run for quite a some time. The problem I'm facing is I'm unable to lock the console output to ...
2
votes
1answer
1k views

Task scheduler doesn't work unless I run it manually

I have a scheduled task on my Windows 2008 R2 server which is supposed to run a powershell script to download a backup of a file from another server. On this same server, I have scheduled the exact ...
2
votes
1answer
521 views

Version 1 powershell, get-childitem to look only in a listed directory, not all subfolders

I have v1 of powershell on my servers. It would be easy if I had a newer version of PowerShell but that is not an option for me at this point. I have a script that looks to see if a file in a ...
2
votes
1answer
567 views

How to enable CredSSP

I am trying to use the -Authentication CredSSP switch when entering with PowerShell (2.0) in order to remotely launch a Script that can write to files or set up new PSDrives. I get an error when I ...
2
votes
1answer
2k views

PowerShell Remoting using CredSSP is broken

I recently had PowerShell working perfectly with CredSSP, but now every time I try to establish a remoting session using CredSSP, I'm getting the following error: Enter-PSSession : Connecting to ...
2
votes
1answer
363 views

How to disable iritating beeping sound in powershell

sometimes I run grep (aka select-string) that has string that occurs too ofter, then powershell goes crazy, sometimes I manage to kill it with ctrl-c, but even then i have to endure irritating beeping ...
2
votes
1answer
471 views

Powershell - find file names within a string when their names are unknown - only their extension is known “.jpg”?

Using PowerShell, how can I get a list of file names within a string, if I only know the extension? Simplified example: C:\> $e = "CN=Ken Myer world.jpg more text." C:\> $f = ...
2
votes
1answer
395 views

Using SQLConnection object in powershell

I want to use the SQLConnection object as I would from vb, for example. I'd like to do this: e.g. $conn = New-Object system.data.sqlclient.sqlconnectionstringbuilder $conn.DataSource = 'myserver' ...
2
votes
1answer
280 views

Git, Powershell, %HOME% and multiple repos

I'm going to start off by saying that I'm not particularly good with either git or Windows. However, I've been successfully using msysgit on Windows 7 for a while now, keeping track of a number of ...
2
votes
1answer
586 views

Running logon scripts with the standard user access token?

I have a powershell script which executes after I logon to my account. This is done by a group policy logon script. Because I am in the Administrator group this script is run with elevated rights ...
2
votes
1answer
2k views

Can't start PowerShell as administrator

I have Windows 7, and I want to run PowerShell as an administrator. I found it in the Start Menu, right clicked it and selected Run as administrator, but I get the following: Windows Explorer has ...
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 ...
2
votes
1answer
1k 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 ...
1
vote
1answer
36 views

Trick for opening Powershell at open directory?

If you type "cmd" into the address bar of a window it opens the command line at that directory. Is there a way to do this same with powershell, thus saving you navigating to some deep recess of your ...
1
vote
1answer
38 views

Grouping files by parts of filename and copy these

I'm trying to find a way to group files together for easy copying. The requirement is that I have filenames like: aa0048.pdf and fg345_aa0048_somethingsomething.xml. There are 25000 files in the ...
1
vote
1answer
20 views

Powershell script to be called by serveral servers to copy log files to remote location

We have several servers that save log files locally and I'm trying to automate logging to a single network location with a name of the parent folder where log files are stored and date modified time ...
1
vote
1answer
47 views

Powershell ISE scrolls to the bottom of the console upon re-focus

With PowerShell ISE: If using a split view (showing both the console and script pane), re-focusing on the console from the script pane (or another console tab) will always scroll to the bottom. To ...
1
vote
1answer
29 views

Conditional Restart Timer - Windows Updates

I am looking to require restarts based on certain conditions within our environment. Currently we deploy Windows Updates via WSUS, but do not enforce forced restarts (this has a long history due to ...
1
vote
1answer
61 views

getting 9th column of data from multiple files and dumping it all into new file

OK guys, I have 24 subfolders, named Angle1, Angle2, etc up to Angle24, each with a file called output.txt. Note that these folders have subfolders which I want to ignore. Is there a way to loop ...
0
votes
0answers
81 views

IP range in command line

I am looking to use powershell and task scheduler in windows 7 ultimate 32 bit to redial vpn should the vpn connection drops. I found a scrip ( ...
0
votes
0answers
181 views

Setting up microsoft intune, need to lock down computer

So, I have an initiative to set up Microsoft Intune on a number (~450) remote computers. Those computers are currently running deep freeze to reduce the damage that people can do to them by ...
0
votes
0answers
239 views

Share tiles and secondary tiles between user accounts in Windows 8

Our Windows 8 Metro application secondary tiles that we need to share between several user profiles on a single PC (tablet). I was wondering if it is possible to copy secondary tiles (as opposed to ...
0
votes
0answers
142 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 ...
0
votes
0answers
87 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, ...
0
votes
0answers
152 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
0answers
603 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 ...
0
votes
0answers
159 views

Powershell and Thinkvantage Access connections

I am looking for a way of letting Powershell control the Thinkvantage Access connections program but I can't find any good starting points/guidelines for how to get started. In the end, I want Access ...
0
votes
0answers
520 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
0answers
336 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
0answers
102 views

Create DFS folder with particular permisson?

How to create DFS Folder with particular permisison using powershell script
-3
votes
0answers
44 views

Code to Reset Google Chrome Advanced Settings

I'm looking for a code which can reset Google Chrome's Advanced Settings. You can do it manually, by going to Settings > Show Advanced Settings > Reset Settings > Reset Instead, I want code that ...