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

0
votes
1answer
44 views

Creating Virtual Disk in PowerShell / Help Understanding Error

I am trying to setup a new Virtual Disk in Hyper-V Server 2012 r2. Since there is no GUI, I would like to do this using PowerShell. So far I think I have successfully created a new pool from two ...
3
votes
0answers
71 views

What are AMT sessions used for?

I'm familiar with Powershell sessions (ie Enter-PSSession) and what they can be used for. I'm attempting to remotely manage power through vPro, so I've been messing around with the IntelvPro module ...
-1
votes
1answer
113 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 ...
1
vote
0answers
37 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
99 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
143 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 ...
1
vote
2answers
2k views

Is Windows Powershell as powerful as terminal of UNIX/Linux? [closed]

I've been wondering if Windows Powershell is as powerful and efficient as Linux' terminal. People offline tell me, without explaining much, that Windows Powershell is an attempt to make UNIX ...
0
votes
2answers
373 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
268 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 ...
4
votes
1answer
122 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 ...
0
votes
1answer
102 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
60 views

Powershell not exiting when called from Orchestrator

I'm trying to run a powershell script from orchestrator. The script works fine from my interactive prompt but when run from a orchestrator runbook it never exits and the overall runbook appears to be ...
0
votes
0answers
91 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 ...
0
votes
1answer
210 views

Get song duration from an mp3 file using Powershell

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
129 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
1answer
160 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
72 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
1k 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
211 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
110 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
311 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
106 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
0answers
55 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
160 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
267 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 ...
3
votes
1answer
330 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
484 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
81 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
22 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
146 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 ...
2
votes
3answers
500 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
87 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
189 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 ...
2
votes
1answer
608 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 ...
0
votes
1answer
85 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
60 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
271 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:\> ...
2
votes
2answers
80 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
83 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
182 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 ...
1
vote
2answers
138 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
66 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 ...
6
votes
1answer
1k 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
984 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
494 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
626 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 ...
1
vote
1answer
346 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 ...
0
votes
0answers
33 views

Error while creating home directory for a local user account through powershell

I have seen the following as a suggestion to create home directory for a user. So I have tried the following script to create a home directory : $sec_password = ConvertTo-SecureString ...
0
votes
0answers
35 views

HomeDirectory is not getting created through powershell scripts

I tried the following to create a user and assign a home directory to the user. $comp = [ADSI]'WinNT://localhost,computer'; $user = $comp.Create('User', 'account14'); $user.SetPassword('Welcome1$'); ...
1
vote
1answer
2k 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 ...