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

-1
votes
1answer
220 views

Invalid date value in csv file

I export data in csv format from sql server database. It contain 5 column. one column have date and time value. When i checked the date -time value i found date time value is in wrong format. I add ...
2
votes
1answer
105 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 ...
1
vote
2answers
689 views

Batch file for starting powershell in a specific directory

I am learning to program in python through the book "Learn python the hard way". Therefore I use powershell to run my programs. Since I had to manually change the directory every-time I started ...
1
vote
3answers
2k views

My hard drive is just randomly vanishing?

My second drive is just randomly vanishing. It's a SSD. I can be in console on the drive and all of sudden I get: Set-Location : Cannot find drive. A drive with the name 'F' does not exist. At ...
13
votes
2answers
18k views

Is Windows PowerShell as powerful as the terminal of Unix/Linux? [closed]

Is Windows PowerShell as powerful and efficient as Linux' terminal? People offline tell me, without explaining much, that Windows PowerShell is an attempt to make Unix administrators feel more ...
9
votes
2answers
19k views

netstat with process name?

Using netstat -a -o -n I can get the list of ports and PID then I need to go to task manager and add the PID and see who is it. (pretty frustrating) I was wonder if there is a CMD command which ...
0
votes
2answers
805 views

Removing Duplicate Files With Powershell

Powershell Has been shipped stock since Windows Vista. I have many clients who download files, forget where they end up redownloading the same exact file. These files if they are duplicates are ...
3
votes
1answer
450 views

Why does running PowerShell change my console font?

I have a strange problem on my laptop - when I run Powershell within an existing console window, the font choice for the window changes. For example, this is cmd.exe immediately after opening the ...
1
vote
1answer
250 views

search emails by originating IP

Is there a way to search emails either via the message tracker or via PowerShell that will show me all the emails coming from a particular IP? That is the X-Originating-IP in the Internet header. To ...
0
votes
0answers
179 views

Can't extract really long file name with 7-zip

I have scoured this page which seems to be the only info I can find on extracting really long file names. Although the examples in this page deal with compressing, I would think the same principles ...
1
vote
1answer
1k views

Get song duration from an mp3 file in a script?

I am trying to list some of my mp3 files with Powershell. I have tried ls C:\test | Format-List -Property Name,Length which gives me Name : testfile.mp3 Length : 10058533 The length is the ...
0
votes
2answers
484 views

Remove all but URL-s from XML files

So i have a XML with bunch of links. What i want is to remove everything that is not an URL. For example currently it looks something like this: <update extract="1"> ...
1
vote
2answers
404 views

Read x64 registry branch from 7-zip SFX Installer via PowerShell

I want my 7-zip self-extracting archive to run a PowerShell script after it extracts files. To do that, I use method described here: ...
0
votes
1answer
172 views

Look for many different strings in many different log files?

I have a list of files that have gone missing somewhere in our system at work. I also have a folder full of 41 log files adding up to 46 MB that hopefully have log entries pertaining to the missing ...
1
vote
2answers
3k views

PowerShell script to copy files is having issue with directory path with spaces in it

I have a list of files to copy to/from different locations. Unfortunately, one of them has spaces in the subdirectory. Not all of them have subdirectories, and not all have spaces. This is a ...
2
votes
1answer
464 views

Powershell: how to get logged-in users list in active directory?

I need to generate this table: Computer | User | last log in date(never) This one asks for username for each user account and returns only ad server name against which the user was last ...
1
vote
1answer
363 views

Adding Powershell command to right click menu both on and in a folder

There are some solution online but most of them just add the command when you right click on the folder. I've find a solution (which work both) for Run As Administrator here. But it works just for ...
2
votes
1answer
1k views

PowerShell periodically hangs after any command

My PowerShell shell sometimes hangs after any command - such as ls. Also, after I force close the window, when I open another shell window, it shows the following error: Windows PowerShell Copyright ...
0
votes
1answer
339 views

Replace a variable with its value inside powershell command prompt

In Windows PowerShell, is there a way to "evaluate" a variable so that I have its value pasted into the command prompt? The usage scenario I would like to perform is as follows: let's say I have a ...
1
vote
1answer
68 views

CredSSP - How does it work?

Been trying to find a web site that lists the steps carried out to perform authentication - but to date have not found one. The reason being is that it is broken. Get 500 server error and have not ...
0
votes
1answer
768 views

Cannot create a folder because such folder already exists?

Running under Windows 7 Enterprise SP1 x64. When I try to create a folder with a certain name (for reference, let's assume it's X:\MyFolder, I'm getting this: The name I am using does not show as ...
1
vote
1answer
1k views

one-click script o backup and restore individual registry keys

I have an application that stores some settings in registry. For whatever reason, it loses some stuff on occasion. I don't really have time to figure out what the problem is (it's not even guaranteed ...
4
votes
1answer
553 views

Powershell scripts works manually but not as a scheduled task

I have a powershell script that converts .doc to .pdf files. When I execute it manually, it works perfectly on my windows server 2012. When I execute it as a scheduled task, opens an instance of ...
1
vote
1answer
3k views

PowerShell remoting authentication

When I am logged in as the same user as the server, I can Enter-PSSession with: > Enter-PSSession -ConnectionURI http://xxx.xx.xxx.xx:5985 However, when I'm logged in as a different user (on the ...
1
vote
2answers
179 views

How to Add Scripts to Path?

I've stored commonly used powershell scripts at %USERPROFILE%\Bin. I created a USER_BIN environment variable which I added to the user PATH environment variable via Control Panel > System and ...
0
votes
1answer
31 views

Should I delete data before deleting its partition and extending over?

I have multiple computers with the main drive split into C and D partition. D just has random data, C has the OS. I plan on copying over data from D to C then deleting D and extending C over it. Can I ...
1
vote
1answer
838 views

Piping all output from Get-ChildItem

I'm trying to make a basic powershell command work, but I'm having some difficulty with the piping system. I'm using Fossil for my version control system, and have made the majority of my programs ...
3
votes
3answers
3k views

Using the .NET Framework ArrayList Class - How to find methods

How can I find what methods and properties the ArrayList class has? I am a junior sys-admin, teaching myself Powershell. I know about coding, what a dog knows about a clock. In Powershell I can ...
0
votes
2answers
114 views

Concrete cases for CMD/BATCH use [closed]

Please excuse my inexpertise. I don't have much experience with the command line. From my searches, the main reason for CMD use(*) is automation. I haven't, though, found concrete cases. Most ...
0
votes
1answer
762 views

Powershell won't start, fails with 'Value cannot be null. Parameter name input'

I have a brand new install of Windows 8.1 with Visual Studio. Running Powershell opens a window that closes immediately. Launching powershell from cmd.exe, I get the following error: Windows ...
3
votes
1answer
2k views

Powershell Rename Multiple Files with LastWriteTime Prefix

I am trying to put together a Powershell script that will: -Search recursively from a root directory -Exclude files with existing "yyyyMMdd " file name prefix -Rename the files not excluded above ...
1
vote
1answer
638 views

How to list a file and execute in powershell

I am trying to get the file names in a directory which are exe and then execute them one by one: $files = get-childitem mydirectory foreach ($file in $files) { $file /s } But somehow the ...
0
votes
1answer
138 views

How do I Refresh my shortcut file in Windows 8.1

OK so I was trying to change the color of the tiles in Win 8.1 and came across this link Customising Start Menu However I didn't understood the Step 7 and have no idea what do do that. I created the ...
4
votes
1answer
1k views

Environment.OSVersion in PowerShell vs PowerShell ISE

Why is it that I see 2 different versions of my OS from PowerShell and PowerShell ISE? The OS: Microsoft Windows Server 2012 R2 Datacenter Evaluation PowerShell: version 4.0 PowerShell PS C:\> ...
3
votes
2answers
157 views

Windows command line to do 'Edit' action?

The start command (in PowerShell an alias for Start-Process, in cmd.exe a shell builtin) does the same as the Windows Explorer context menu 'Open' action: it opens the file using the application which ...
1
vote
1answer
142 views

Vim & Powershell - send selection to command

I have a list in a file, and lets say I want to send it to the sort cmdlet (which is just for describing purposes, any cmdlet could act as a filter) My vim shell setup is: set shell=powershell set ...
0
votes
2answers
486 views

Powershell: gci filter with compact output

I want to find files recursively, and for that I am using > gci -name -filter *.py -r Option -name gives only the file name, to get one line per item found, as required. But the items that I get ...
5
votes
2answers
689 views

PowerShell: Env: Avoid truncation of environment variables

PowerShell displays environment variables, one line for each. If a variable has a long enough value, it is truncated, and appended an ellipsis: > gci env: Name Value ...
1
vote
0answers
96 views

How to pipe a group of files through a .exe using powershell?

I am currently using a .exe named "vbadecompiler.exe" to process a group o ".xlsm" files. Those are to many to process manually therefore Powershell seems like the answer. My current attempt is the ...
8
votes
2answers
5k views

Powershell opening with ridiculously tiny font (about 5) and won't change to new default settings

Powershell is opening with extremely small font (about 5 pts). When I go to Defaults > Font, the setting is a reasonable 8 x 12 pixels but that is not what is showing on the screen. I try changing ...
1
vote
1answer
3k views

Powershell/CMD command to open IE10 in compatibility mode

I am looking for a powershell command to open Internet Explorer 10 in compatibility mode like C:\Program files(x86)\Internet Explorer\iexplore.exe www.abc.com opens www.abc.com in IE10. I want to ...
1
vote
1answer
935 views

Can logon script be assigned to a user in a windows machine which is not a part of domain through powershell?

This is the suggested way to add a logon script to a local user in Windows. http://technet.microsoft.com/en-us/library/cc770908.aspx Edited: I also found the following : ...
4
votes
2answers
744 views

Who is the Inventor of Windows PowerShell [closed]

Purely out of curiosity, who is the inventor of the Windows PowerShell ? As I have seen it on every Windows machine. So could someone please give me an insight on who the inventor of the Windows ...
2
votes
1answer
855 views

Is there a PowerShell cmdlet to enable Hyper-V “Enhanced Session Mode Policy”?

I am running Hyper-V on a Windows Server 2012 R2 system, which is getting staged via SCCM. Now I am wondering if there is a way to enable enhanced session mode policy using powershell. Unfortunately i ...
3
votes
1answer
6k views

How can a PowerShell script be automatically run on startup?

I have a PowerShell script to monitor an image folder. I need it to run automatically on startup. I tried to use MSConfig, but I could not find it in that list. How can I have the script ...
0
votes
0answers
461 views

Monitoring a folder using PowerShell

This script will monitor a folder, if new images are created, move them to the image folder. Very simple. But I got it partially working. The problem is only old images are moved; newly created ones ...
4
votes
2answers
3k views

Windows Backup Using Powershell

I wrote the following Powershell Script to perform a one time backup of my Windows Server 2008 R2 machine. The idea is to perform a Weekly backup to a different external drive and schedule the script ...
1
vote
0answers
233 views

Trying to make a symbolic link to a Powershell script

I'm trying to create a symbolic link with mklink through a Powershell script to a Powershell script on a remote server. this link should come on the desktop of all users. if(!(test-path -path ...
13
votes
7answers
16k views

Powershell font too small on Windows 8.1 - how to adjust?

Question: On my Windows 8.1 machine, I need powershell to configure office web apps. When I start powershell, for a blink of a second, it shows as it should, but then it gets resized, and the font ...
2
votes
1answer
481 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 ...