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
335 views

PowerShell – Remove specific SMTP addresses from proxyAddresses array

I have been trying to figure this out how to modify the proxyAddresses of some of my users in AD using PowerShell. My basic goal is to use Get-ADObject to query AD for a specific set of users and ...
0
votes
0answers
61 views

How to access files in network drive to search for a string in that file?

I am using below code in windows powershell to search for a string and give filename as output if string is found. $a=Get-ChildItem -r | ? {$_.psiscontainer -eq $false} | ? {gc $_.pspath ...
4
votes
1answer
841 views

Get HP Product Number via Powershell

I have put together a robust HP Warrant Lookup PowerShell script. However, I cannot figure out how to get a HP system's product number in an automated process. So... How can I get HP product number ...
0
votes
1answer
110 views

Robocopy: copy files preserving folder structure but adding a subfolder

I need to copy a folder which contains subfolders with files to a shared folder on another machine. During that, the script should create a custom subfolder in each destination folder and place files ...
1
vote
1answer
82 views

Grep analog in Powershell

I'm trying to make a port for a project from linux to MS Server. The problem is that there is grep command with special options grep -c string and grep -e which I need to convert. Found that similar ...
2
votes
2answers
159 views

Have Windows (or PowerShell) Log Everything I do in a Command Line?

Is it possible to have windows log every command I type & the output I see on the console? Sometimes I find that I want to see what I did 2 hours ago just to be sure I typed a certain parameter ...
1
vote
1answer
111 views

Is there a limit to the number of IP addresses for a Windows Firewall rule's Scope?

I've got a Powershell script that adds IP addresses trying to run brute force attacks on my server to a firewall rule that blocks them from accessing it. Recently it stopped working, and started ...
0
votes
1answer
47 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
116 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
109 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
166 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
463 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
278 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
124 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
105 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
63 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
92 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
229 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
140 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
171 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
74 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
215 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
111 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
330 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
114 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
176 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
295 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
332 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
532 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
83 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
23 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
159 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
531 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
199 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
636 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
87 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
63 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
323 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
82 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
87 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
189 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
151 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 ...