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

-2
votes
2answers
38 views

What is the best way for the system user to open a file as another user?

I'm looking for a secure way to allow SYSTEM to open a file/application as another user in an automated scenario. Currently I'm doing it with PSExec, however this exposes the users credentials if ...
0
votes
0answers
14 views

Powershell Add Firewall rule for remote desktop

I was running the following commands to enable remote desktop via powershell set-ItemProperty -Path 'HKLM:\System\CurrentControlSet\Control\Terminal Server' -name "fDenyTSConnections" -Value 0 and ...
-1
votes
0answers
12 views

The Powershell console hangs after a command execution

From time to time, though rather frequently, my Powershell console hangs after a (both successful and unsuccessful) command execution. I use the Powershell version 2.0.-1.-1 for the Sharepoint 2010 ...
-1
votes
0answers
22 views

Syntax to record the “User Objects” count for iexplorer.exe process [on hold]

How to record the “User Objects” count for iexplorer.exe process?
0
votes
0answers
13 views

How can I get all urls of pattern x from a paged list of search results?

I'm using Windows 7 SP1, and I'm willing to use powershell or wget or whatever will work. I downloaded powershell today (ps 4) and I've got some scripts working, but I'm having trouble with this one. ...
0
votes
2answers
16 views

Viewing all accessible drives in PowerShell

I noticed that cd \ navigates to the root of my drive. But there are other drives that I can access on my computer. Is there a command in PowerShell that lists all of the drives that I can connect ...
0
votes
2answers
21 views

Powershell script to list folders in all shares

Stupid question but not sure if this is possible. I have a file server hosting 8 separate shares. I was looking for a script to pull a list of the folder names (No subfolders) for all of the shares. ...
0
votes
1answer
16 views

Can't run start-process command

I'm trying to run a command found in this answer. The command is start /w %SystemRoot%\system32\pkgmgr.exe /ip /m:Windows6.1-KB2506143-x86.cab Trouble is, it doesn't work for me. Indeed, it ...
0
votes
1answer
15 views

Why does this script prompt me for an InputObject?

I have a script that is supposed to list all the installed programs on a machine. I want it to export it to a file for me. I keep getting the error: Supply Values for the following parameters: ...
2
votes
0answers
52 views
+100

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 ...
1
vote
1answer
35 views

Windows Power Plan automation

I like to keep my Asus ROG G750JZ(laptop) on all the time and I have already automated sleeping at 01:00 in the morning, auto wake-up on opening the lid. However since I am not using the laptop all ...
1
vote
1answer
22 views

Can't install PowerShell 4.0

I'm trying to install PowerShell 4.0 on a Windows 2008R2 server Installed Windows6.1-KB2819745-x64-MultiPkg.msu with no errors or warning But when I run up PowerShell and check the $host.version, ...
0
votes
1answer
25 views

Using PowerShell to Close Firewall Port

I'm doing some end to end testing of an application and I need to be able to close then open a port in Windows Firewall using PowerShell commands. I've found a script that adds a firewall rule to open ...
0
votes
0answers
20 views

How to install a mmc certificate on Windows?

I am not familiar with Windows very much, and I have trouble installing a MMC certificate. I am following this description to use MMC to create a certificate, but I cannot complete the step labeled ' ...
-2
votes
1answer
57 views

How to connect to a remote Windows computer using Enter-PSSession on PowerShell?

I am trying to connect to a remote windows computer using Enter-PSSession using PowerShell. As a Linux user, I am not very familiar with the inner working of Windows. When just using the command I ...
1
vote
1answer
29 views

How does one start the Powershell ISE with no file open?

When I launch powershell_ise.exe, it defaults to having an open file "Untitled.ps1". Is there a mechanism to ask ISE to launch showing only the prompt? That is, at the moment when I launch Powershell ...
1
vote
1answer
25 views

Listing Mapped Drives and Username Powershell Script

It's been a little while since I've touched PowerShell so struggling to get this working as I expect. $computerlist = Get-Content H:\MappedDrive\ListOfMachines.txt ForEach ($computer in ...
1
vote
1answer
34 views

Is it possible to install PowerShell 3 on a Windows Server 2003 or 2003 R2?

On a Windows Server 2003 rig (which already has .NET 4 but no 4.5 on it) that is to be expired before the end of the year, I'd like to run a few PowerShell 3 scripts on a scheduled base as the scripts ...
-2
votes
0answers
16 views

Multiple Directory Creation based on domain username and set file sharing script request

I need a script that will do the following. Create multiple directories labeled by domain usernames (I'm thinking pulling the usernames from AD and add the username to each command.). In a shared ...
1
vote
0answers
27 views

Automation of control panel > Wireless Network settings(802.11 modes) through Powershell or any other automated procedures

I want to automate the "Control Panel\Network and Internet\Manage Wireless Networks" page in Windows through Powershell or any other automated procedures, to change my wireless adapter's mode to all ...
1
vote
2answers
26 views

Get-credential results in “system cannot find the file specified”

I'm trying to write a powershell script that prompts for credentials and opens a webpage as the user. I have start-process -credential (get-credential) -filepath "http://www.microsoft.com" It ...
0
votes
0answers
25 views

Windows Symlink & Copy

I am trying so desperately hard to map a drive to sharepoint online with little success. (I have tried everything possible to get this working.) Closest I have got is being able to make a shortcut to ...
5
votes
3answers
65 views

Why does the PowerShell ISE not isolate script variables to the script scope?

In PowerShell, scoping is supposed to keep objects (variables, aliases, functions, etc) in scripts from affecting the global environment. This appears to work fine at the command line, but not in the ...
0
votes
1answer
27 views

PowerShell will not start

I am getting this message when trying to run PowerShell Version v4.0.30319 of the .NET Framework is not installed and it is required to run version 3 of Windows PowerShell. I have tried repairing ...
4
votes
2answers
94 views

How can I delete over 2,000,000 files in a single directory efficiently?

I have over 2,000,000 (that's right, over 2 million) files in 'Temporary Internet Files'. This predicament is the result of a scheduled task that runs a script. After installing Visual Studio, it has ...
0
votes
0answers
35 views

PowerShell script to install software and handle reboots

I'm currently trying to write a PowerShell script and I don't know how to do it the best way. The goal (on 1 computer) : uninstalling a program silently (I have the package and the silent ...
0
votes
1answer
28 views

powershell - positional error if move files/folders from a text list

I try to move my folders and files from a text list but i have this error, i use windows server 2012 Windows PowerShell Copyright (C) 2013 Microsoft Corporation. All rights reserved. PS ...
1
vote
1answer
26 views

Open Powershell in ConEmu from context window

I would like to open Powershell inside ConEmu from Windows Explorer's context menu so that it contains the same directory as Windows Explorer. I know about the "Integration" settings, but I cannot ...
1
vote
1answer
20 views

Configure WinRM to Use HTTPS makecert.exe Name Syntax

I am trying to enable the remote execution of powershell scripts on a remote server over https using this example. What I do not understand is what value to give for the hostname when generating the ...
0
votes
2answers
50 views

List of MAC addresses for 10 machines

I need to list of MAC addresses for a 10 computers having Windows 7 installed on them. These are named in a series like training1 - training10. There IP addresses are on DHCP mode and update every ...
0
votes
2answers
66 views

Powershell run programs with arguements as different users

I am trying to create a Simple (or so i thought) at startup Script for my Work Machine. For this i need to mainly open IE Firefox as logged in user Firefox as Admin user Outlook as main profile I'm ...
0
votes
0answers
39 views

App Path incorrectly set as REG_SZ

I have Windows 7 Ultimate Service Pack 1 with PowerShell 4.0. Under this key HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths\PowerShell.exe I found these values (Default) ...
-1
votes
1answer
22 views

Deleting entire line based off of string in powershell…and keeping the line below?

I'm having some issues with powershell. What I am trying to accomplish is this: file.txt = string1 a string2 b I am using the command: Get-Content C:file.txt | Where-Object {$_ -match ...
0
votes
1answer
28 views

How do I install the PowerShell Community Extensions (PSCX)

I'm on Windows 8.1, and fairly new to Windows-side development. I've had PSCX suggested to me, but for the life of me, I can't figure out how to install PSCX 3.1 on Windows 8.1 and make the cmdlets ...
0
votes
0answers
46 views

How to change the Start In property via CMD for an .lnk

Context: I have folders with presentations being created dynamically except currently an instance of our ppt&macro is being dropped in each folder with the presentation. The presentation will only ...
0
votes
0answers
16 views

Setting up WINRM for remote powershell scripts over https

I have set up powershell and winrm to run remotely over http but we have a new server provider and they want this set up over http. Do I have to create an IIS site and set, complete with certificates ...
0
votes
1answer
27 views

Download Excel_data.xls compare with excel_local.xlsx and import

I am trying to write a PowerShell script that will download some Excel data from a webpage, then compare the data to my local file and import the data if there is a duplicate I would like it to add a ...
1
vote
1answer
49 views

Given a list of KB numbers for Windows Updates, how can I find out what's in the updates?

I have this issue with a program I work on, where the program behaves differently on my development machine v. the QA environment. I suspect the difference between the environments lies in which ...
0
votes
0answers
77 views

Powershell Split Large Text File to Individual Files

I am working on a Powershell script that will allow a user to define a large text file, have the script run, then save a portion of that large file to individual files with a unique file name which ...
2
votes
3answers
193 views

Which Powershell Function could check whether a certain port is in LISTENING state on localhost?

Introduction Aim: to check whether a port is in LISTENING state on localhost by using a PowerShell function The following command: New-Object Net.Sockets.TcpClient.Connect("127.0.0.1",10389) ...
0
votes
1answer
39 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 ...
2
votes
1answer
102 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
1answer
50 views

how to batch change date created to date modified

I have many video files ending with extensions mov, avi, mp4, and mts. I need to change their "date created" to their "date modified value" I tried using the following powerhsell script: ...
0
votes
1answer
42 views

What is the equivalent of rm -rf in Powershell?

As we all know, on a *nix system, rm -rf some_directory removes some_directory and all files beneath it recursively, without asking for confirmation. What is the equivalent of this command in ...
0
votes
1answer
52 views

How do I rotate an image clockwise using the Windows command line?

Is there a way to rotate images stored in folders clockwise so they can be changed from Landscape to Portrait using CMD or Powershell? If there isn't a way to do it then please let me know. It might ...
0
votes
1answer
9 views

Powershell - acquire the system proxy

How do I acquire the Windows system proxy using Powershell? I know about this $webproxy = (get-itemproperty 'HKCU:\Software\Microsoft\Windows\CurrentVersion\Internet Settings').ProxyServer Is ...
1
vote
5answers
176 views
+200

How can I both pipe and display output in Windows' command line?

I have a process I need to run within a batch file. This process produces some output. I need to both display this output to the screen and send (pipe) it to another program. The bash method uses ...
0
votes
1answer
39 views

Stuck in Powershell sqlserver

I'm a bit of a powershell newbie. So I've created a script that uses the Restore-SqlDatabase commandlet. However, after I run it, it leaves Powershell in a different state. PS D:\theFolder\> ...
1
vote
1answer
23 views

Autorunning a series of .cmd files when usb is plugged in [closed]

I'm trying to automate a process to the simplest way possible for non technical lab students. This is my first time doing longer scripts so bear with me. I need the drive to: Check that the user ...
0
votes
1answer
161 views

How to calculate the StartTime / UntilTime parameter using Get-Printer in Powershell?

I have an printer setup using the GUI and set the printer availabilty from 18:40 until 3:00 As well i got the PS command "Get-Printer Printer1 | format-list" The result of the command puts out: ...