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
0answers
39 views

Add Increasing Numbers to Beginning of FileName in Powershell

I have a set of files in a folder, all pdfs. There is no uniform name to the documents, but I would like each one to be proceeded by a number, followed by an underscore, then "TAB." In other words, ...
2
votes
2answers
77 views

Replace Command Prompt with Powershell on Power User Menu

I would like to replace the Command Prompt option on the power user (Winx) menu with and option for Powershell. Like many Windows user I've slowly been transitioning from using the traditional windows ...
0
votes
0answers
19 views

Stop PowerShell from sharing command history between simultaneous instances

Let's say I have two PowerShell instances open simultaneously. If I type a command in one of those instances, hit enter, switch to the other one and hit "up", the command I previously typed appears ...
0
votes
1answer
72 views

How does start.exe work?

I found out that start.exe might be useful as a tool intended to run installed programs. So I can run Word: start winword # located in "C:\Program Files\Microsoft Office 15\root\office15\WINWORD.EXE" ...
45
votes
2answers
48k views

How do I run multiple commands on one line in Powershell?

In cmd prompt, you can run two commands on one line like so: ipconfig /release & ipconfig /renew When I run this command in PowerShell, I get: Ampersand not allowed. The & operator is ...
1
vote
1answer
3k views

How to check whether a specific service exists using Powershell?

Introduction According to this documentation it is possible to check which services have been stopped on Windows by executing the following command: Get-Service | Where-Object {$_.status -eq ...
0
votes
1answer
43 views

Win Server 2012 PowerShell 4 script to Copy, Rename, and Touch a File

I created a PowerShell 4 script to backup the Outlook 2013 VbaProject.OTM file by copying it from the production directory to a backup directory, and adding a filename suffix of the current date and ...
0
votes
0answers
70 views

Power Shell script to delete the User profiles from the windows server 2008 r2 to local machine(Windows 7)

I tried the following script on a Windows Server 2008 R2 to delete the User Profiles on a Windows 7 client machine. PS C:\> get-content localcomputer-list.txt | get-userprofile | where {$_.LastUse ...
0
votes
3answers
2k views

Strip my windows NTFS disk of all ACLs

When you purchase a windows PC nowadays, you don't actually "own" the whole disk... There are so many ACLs on each folder that there are portions of it you actually can access only through a ...
1
vote
1answer
31 views

Powershell - How can I copy full error information in a trap

I am using Powershell's trap feature because I would like to output full error information when there's an error and I have to reply to the error. Without the use of a trap Powershell will not show me ...
0
votes
1answer
179 views

PowerShell script to decrypt file

Can some one help me with this command to decrypt files using powershell? echo YOURpassPHRASE | gpg --keyring "C:\directory\filepath" --secret-keyring "C:\directory\filepath" --batch --yes ...
1
vote
0answers
32 views

get-command : Object reference not set to an instance of an object

I have PowerShell 4 on a Windows 7 laptop. I just installed PowerGUI, and discovered I am getting this error: get-command : Object reference not set to an instance of an object. Powershell_ISE, ...
0
votes
1answer
22 views

Removing a Group from Offline Global Address List in Powershell

This is for an Azure Office365 tenant: Basically, when I run a an object query against a group like this: Get-UnifiedGroup "GroupName" | Select Object * It gives me a list of all the different ...
0
votes
1answer
24 views

Replacing text in multiple files-getting duplicate error

I want to loop through all files (2 for this test) in current folder and replace text. The replacement is working but I'm left with newfile1 and newfile2 in file1 and the same in file 2. Where I just ...
29
votes
5answers
66k views

how to run a powershell script as administrator

On my Windows 7 Desktop, I have script.ps1, which needs admin privileges (it starts a service). I want to click on this script and run it with admin privileges. What's the easiest way to ...
1
vote
4answers
6k views

How can I run commands in PowerShell with Administrator permissions?

I would like to run commands in PowerShell with Administrator permissions? How can I do that? I have tried to start PowerShell with the runas command, but PowerShell is closed immediately after I ...
0
votes
1answer
2k views

Sysprep.exe fatal error, and can't delete metro app in windows 8 to get it working

Today I used sysprep.exe to rebuild my windows image. But it always said "a fatal error occurred while trying sysprep". Then I went to check setupact.log file , it shows like this I followed this ...
4
votes
1answer
10k views

Office365 Exchange: Cannot open shared two calendars in Outlook

The problem: Outlook won't open the calendars on another user's mailbox and and a room mailbox, even when users have permission. Note: This problem is affecting more than one account on more than one ...
2
votes
1answer
3k views

Set (Many) Programs' Window Size/Position

I'm looking for a solution similar to this, but for Windows 7 (64-bit), and not just for the terminal. This is also definitely not a duplicate of this question. The Problem Some programs remember ...
0
votes
0answers
27 views

How to create multiple VM using powershell script in azure using single cloud sercice

I am trying to create multiple VM in azure using powershell scripts but I am unable to create. It says The specified Production slot is already occupied.Please help me to resolve this issue. Thanks in ...
1
vote
0answers
65 views

Can't run PowerShell as admin inside of Webstorm

I am trying to figure out how to run PowerShell as an admin embedded in Webstorm. I can run PowerShell as non-admin in Webstorm, but when I try to run PowerShell as admin inside Webstorm I get the ...
0
votes
1answer
32 views

Parse and Switch Elements of Folder Names using Powershell

I have been trying to write a powershell script (my first) to parse out only the folders within a directory select only those folders matching a specific naming convention ('SEASON YEAR') switch the ...
2
votes
2answers
87 views

Using Advanced Parameter Sets in a Function with Multiple Unique Switches

I am using Powershell 4.0. I am attempting to write a cmdlet and in this cmdlet I would like to use Advanced Parameter sets to have certain options available based on what parameter(s) is/are chosen. ...
0
votes
0answers
45 views

Wake up computer from sleep to shutdown

I wonder if it is possible to wake up the computer from sleep at a certain time during the day and shutdown automatically. Maybe giving a popup asking for 5 seconds if I am using the computer to give ...
1
vote
1answer
45 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 ...
0
votes
0answers
13 views

AD: Best way to streamline Exchange permissions

Looking at streamlining some local helpdesk processes, and one of the most common requests that we deal with is requests for a user to have access to another's mailbox. Typically, we grant this access ...
0
votes
1answer
42 views

PowerShell - Quasi equivalent strings are infact not equivalent?

I have a string which I'm passing into my script as an argument. For the purpose of displaying the code on here however, I have specified these manually in the code. These variables are: ...
1
vote
1answer
34 views

Unique identifier for USB drive in Powershell

According to win32_volume class documentation here the device name that shows up under device manager is is unavailable as a property of win32_volume. Is the SerialNumber property unique to the device ...
1
vote
2answers
32 views

Powershell: Dir /s - Remove Repeated Folders

Situation: In Powershell, I'm using: $folders = dir -s C:\Users\Name\Downloads\*.ttf | Select Directory foreach ($folder in $folders) { echo $folder } To display folders whose contents ...
0
votes
1answer
28 views

Getting System Health info via PowerShell

Is it possible to get System Health status via PowerShell? Info like CPU Utilization, Used RAM, CPU temperature, etc.
0
votes
1answer
50 views

Spawn command line prompt to a remote Windows machine

Is it possible in Win7, Win8.1, Server 2K8 and 2012 to "shadow" or rather spawn a console and 'impersonate' or 'masquerade' a user command line prompt ? I am domain admin and I would like to interact ...
1
vote
0answers
27 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 ...
0
votes
0answers
65 views

Enter-PSSession does not work for remote access

I want to have remote access to one of my server but there are some problems. first of all when I want to add this server(m-ad-vserver) in dashboard of server manager this error appears: ...
5
votes
3answers
9k views

How to determine mac address of a modem on Windows 7?

For a validation process I need to know the MAC address of a cable modem. (I do not need to know the MAC address of the network adapter.) The cable modem though is placed somewhere hardly accessible, ...
0
votes
0answers
49 views

Python/Powershell Script for Telnet

I'm most familiar with powershell and python so a solution which utilized either of them would be ideal. I'm also open to other ideas on resolving this issue. So I have a situation where an old ...
1
vote
1answer
80 views

Nano alternative for windows powershell

I am looking for software similar to nano for linux bash but for windows powershell. Is there any built in so I do not have to install something? EDIT Nano is a text editor that runs within the ...
2
votes
0answers
26 views

How do I send an already running process to the background in power shell?

In bash, a process that is already running in the foreground can be suspended by hitting control Z. You can then bring it back to the foreground with fg or let it continue running in the background ...
0
votes
0answers
16 views

powershell sort and filter a file with multiple filter files

I have multiple files Collect.log a file with all the software known on a computer keep.log software that should be kept remove.log software that should be removed out.log all software from ...
0
votes
0answers
25 views

PowerShell font changes after launching

I'm trying to set the font of PowerShell to be Lucida Console 14, but something strange is happening. When I launch PowerShell, the font is what I want it to be, but a second later (before the prompt ...
1
vote
1answer
22 views

Archive of Microsoft's Powershell 2.0 Documentation?

When looking up information on a specific cmdlet built into Powershell, Microsoft let's you choose between version 3.0, 4.0, and 5.0. See this page for an example - ...
0
votes
0answers
25 views

How to download file from a local server cache windows server

How could I download a files from a local server cache address path I was given? Not sure how to do this on windows server: Link to local sever cache: \\sdgd07mjbvbw2\Users\BuildUser\Downloads Here ...
1
vote
2answers
61 views

Colored text in command prompt/PowerShell is blurry

A troll must've mucked about with my computer during the night. I did not see this issue yesterday. It seems like only colored text is affected by this blurry madness. What is going on and how do I ...
0
votes
0answers
32 views

How to transfer files from PC via powershell

By either browsing out to the remote computer's filesystem (ex. cd \computername\share) or using PSsession, how can I transfer files to and from the remote machine? Tried: copy-item \source ...
1
vote
0answers
42 views

How do I use the Python commands in PowerShell?

I work in a GIS department and I'm trying to learn Python to automate something boring. I started using "Learn Python the Hard Way", but I can't figure out how to run Python scripts from PowerShell. I ...
3
votes
2answers
31 views

Hard Code a system value?

I work for a Tech company, and when we sell computers we also include a sticker with an inventory number, for easy reference in our database. My question is as follows: Is there a way (I am sure ...
0
votes
1answer
47 views

PowerShell unable to Set-Execution policy

I am trying to set the script execution policy in PowerShell. But when I tried, I get: PS C:\Users*> Get-ExecutionPolicy Restricted PS C:\Users*> Set-ExecutionPolicy RemoteSigned ...
2
votes
1answer
56 views

How to rename an executable from its details

I have loads of .exe files that got renamed to file1.exe, file2.exe, etc. When you look at a file's Details under Properties (in Windows Explorer), it has the original file name under "Product Name". ...
5
votes
2answers
888 views

Recursive folder rename through command line

I have 500000 plus files in over 3000 directories and need to rename all folders called PHOTOS to Photos. I also need to Rename any Folders call Photos blah blah blah to be called just Photos. It ...
0
votes
1answer
35 views

PowerShell ISE open previous files

How can I configure PowerShell ISE so that it will open tabs for each file that was previously opened when I closed it? This is particularly helpful since I typically come back to work on the same ...
2
votes
2answers
117 views

Trying to pass variables to Send-MailMessage arguments and failing miserably

So I have a problem. I’m trying to write a scripts that pings a list of hostnames in an external .txt file, and send an email alert if one of them goes down. I’m having a few problems with it, but ...