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

Setting up microsoft intune, need to lock down computer

So, I have an initiative to set up Microsoft Intune on a number (~450) remote computers. Those computers are currently running deep freeze to reduce the damage that people can do to them by ...
4
votes
3answers
159 views

In Powershell, is there a way to save a typed command into history without executing it for later execution?

In Powershell, is there a way, after typing a long or complicated command, to commit that command into the history buffer, but not execute it? For example, you start typing a git commit, within ...
-1
votes
1answer
1k views

Multiple counts from Powershell Get-ChildItem? [closed]

How would I use powershell to count the number of files and the number of folders under a folder, emulating the Windows "properties" of that folder? (get-childitem -recurse).count returns the total ...
2
votes
2answers
2k views

How do I grant a user permission to add local users in Windows 7?

How do I grant a local user account the permission to add other local users in Windows 7 Professional? The important point is, that the local user who should be able to create new accounts must not ...
1
vote
1answer
48 views

Given a file, get the location in a separate (identically structured) directory?

Being completely green to Windows shell and cmd scripting, I'm banging my head against this particular problem but coming up with nothing. What I'm aiming to do is add a context menu item to right ...
1
vote
1answer
4k views

Powershell script to fully automate joining the domain

I'm trying to create a script to completely automate joining the domain to use during a wds image deployment. I don't want to use the WAIK option because the password is stored in plain text in the ...
5
votes
2answers
4k views

Remote powershell permissions restricted to machine

I am unable to execute powershell scripts on a remote server, but only on my current machine - please help. Running the following script to give a list of a temp directory on the remote server works ...
3
votes
2answers
2k views

How to open an Outlook contact using a Windows command-line script?

I tend to store a lot of information in the Notes fields of Outlook contacts. Accessing this detailed info for a specific contact in Outlook 2013 requires many steps on the Windows desktop: opening ...
0
votes
2answers
150 views

How to remap shortcut in Powershell

I want to remap the shortcut in powershell, for example, I'd like to use Ctrl + a to make cursor at beginning of line, Ctrl + e to make cursor at the end of line, etc. I searched the method in Google ...
-1
votes
1answer
1k views

PowerShell, SSH, Keyboard Interactive and Frustration [closed]

Hello Stack Overflowers! My goal is to utilize Powershell and SSH to connect to a Unix system (specifically an Avaya PBX switch). Once logged in, to change the terminal type to ossi (avaya specific) ...
3
votes
2answers
96 views

How can I pass two commands with all their switches in Windows command prompt or powershell?

I want to pass a netstat -t -b 90 command and tell the prompt to simultaneously or successively perform this command to launch network monitor start netmon /autostart.
1
vote
1answer
573 views

Batch script for archiving

I need to set up an archiving task on Windows 7 using Windows command line and WinRAR (or some other similar program). I want to create a script that does this, but I have no prior experience. I want ...
2
votes
2answers
217 views

How can I identify files in my Windows file system where the modified date is X more recent than the created date?

I'm hoping this can be handled with some PowerShell tricks. I have a directory on my work machine (Windows XP) containing tons of PDFs, some of which I've annotated and resaved. I'd like to be able ...
0
votes
1answer
8k views

How to repair powershell installation on windows 7

When I try to run powershell.exe from C:\Windows\System32\WindowsPowerShell\v1.0 I get the error: 'The volume for a file has been externally altered so that the opened file is no longer valid.' I ...
9
votes
2answers
170 views

How to customize the default CursorSize in Powershell

I set he default CursorSize in $PROFILE file like: [Console]::CursorSize = 10 or $HOST.UI.RawUI.CursorSize = 10 But the cursorSize will reset after using another console in powershell, for ...
5
votes
1answer
4k views

Task Scheduler - how to run powershell script with multiple parameters?

I am using powershell.exe as the Program and "-Command "& C:\Windows\logon.ps1; exit $LASTEXITCODE"; ExecutionPolicy RemoteSigned" as the Parameter, but it doesn't seems to be working. Some ...
4
votes
3answers
8k views

How to disconnect a network drive using powershell

I would like to disconnect a network drive (Y:) with powershell. That drive letter is assigned / mapped to a network location. Is there a simple way to do that? I believe "net use XXX /delete" would ...
1
vote
1answer
1k views

PowerShell touch all files newer than

I have found the following question on ServerFault: Windows recursive touch command Which partially answers my question with this answer: Windows recursive touch command However, I would like to ...
1
vote
2answers
325 views

How to rename some files according to their timestamp

suppose I have 10 files generated by the system every day under D:\Temp. The names are RANDOMLY when generated. Assume I need to rename the oldest one to be 'aaa', the second oldest one to be ...
3
votes
1answer
7k views

Office 2013 Click to Run - Primary Interop Assemblies

Given that the Office 2013 click-to-run installer allows no customisation of the installation, whatsoever, how can I install, or where can I find an installer for the Primary Interop Assemblies/.NET ...
6
votes
1answer
2k views

Change directory to previous directory in Powershell

I am a Linux guy, but am trying to be open-minded and learn some Powershell. I miss the ability to cd - back to a previous directory, like in *nix shells. Is there a similar command in ...
2
votes
2answers
975 views

How can I use powershell to list all files I uploaded to server?

At work there's a network and everyone has a username and password that they use to log in. How can I search for my files on this network? I could list all the files like this: cd ...
1
vote
3answers
925 views

powershell create zip from log files

How can I move log files to zip archives with System.IO.Compression.FileSystem in PowerShell? I have more folders with log files per application: app1logfolder |-app1_20130507.log ...
3
votes
2answers
3k views

How to use UNC path correctly to share a folder on remote computer?

I would like to know if somebody knows the correct syntax for giving a folder a share on remote network machine's folder. Please write a syntax you know for sure that it's working. This operation ...
1
vote
1answer
450 views

Powershell script to update XML file content

Please help me create a Powershell script that will go through an XML file and update content. In the example below, I want to use the script to pull out and change the file path in the ...
5
votes
1answer
93 views

Program leaks Black and White onto PowerShell console

Some programs, such as Node Package Manager (npm) and some tasks for grunt change the color of my PowerShell console and leave it that way. Here's a picture: Anyone know why this is happening? How ...
0
votes
1answer
2k views

Set Physical Path Credentials in IIS7 Using Powershell

I have a number of applications under a Default Web Site in IIS7. A number of the applications have to have their Physical Path Credentials set to a specific user rather than using application user. ...
3
votes
1answer
508 views

Detect mounting of a virtual (TrueCrypt) volume in windows PowerShell script

I am using the following powershell script to detect when a particular volume is mounted so I can run a script that will move files from my machine to the device (I don't know much about powershell ...
1
vote
1answer
272 views

PowerShell icon missing from taskbar

Windows Server 2008 R2 SP1 I installed PowerShell 3 by installing Window Management Framework 3.0 (Windows6.1-KB2506143-x64.msu) Somehow the PowerShell icon has gone missing from the taskbar. ...
1
vote
2answers
985 views

How can I write a script to count files modified within a particular month?

I use a PowerShell command to count ZIP files modified within the past 30-ish days, that goes something like this: (gci "\\servername\sharename\foldername\subfoldername\*.zip" | where ...
2
votes
1answer
459 views

How to enable CredSSP

I am trying to use the -Authentication CredSSP switch when entering with PowerShell (2.0) in order to remotely launch a Script that can write to files or set up new PSDrives. I get an error when I ...
0
votes
1answer
156 views

Reducing Exchange Mailbox Sizes to Less Than Their Current Size?

What will happen if I set all mailbox size limits back to exchange defaults on a network if a user's mailbox is greater than the default amount. I don't personally want to try this, but do I have to ...
2
votes
1answer
442 views

ffmpeg drawtext initialization error

I'm trying to convert an image sequence to a video file with some text overlay(eventually frame counter). The command I am using ffmpeg -r 24 -y -i mambo_%05d.png -i ..\3DW_Mambo.wav \ -vf ...
0
votes
2answers
859 views

Powershell get a value from 'query user' and not the headers etc

Task, get the ID from the query user command, I'm trying to get the ID value from the the command 'query user', Example:PS> query user USERNAME SESSIONNAME ID STATE IDLE ...
4
votes
1answer
8k views

How start PowerShell from cmd by specific path

I want to start PowerShell (C:\WINDOWS\system32\WindowsPowerShell\v1.0\powershell.exe) from windows 7 default command line (cmd) and go to the specific path. I used the command: start ...
2
votes
1answer
1k views

PowerShell Remoting using CredSSP is broken

I recently had PowerShell working perfectly with CredSSP, but now every time I try to establish a remoting session using CredSSP, I'm getting the following error: Enter-PSSession : Connecting to ...
1
vote
1answer
108 views

ExecutionPolicy changed automatically

I set execution policy in the powershell console set-ExecutionPolicy bypass get-ExecutionPolicy bypass ==> return bypass and then wait couple minutes, check the policy level again ...
1
vote
1answer
368 views

How to trigger the windows task scheduler event when my computer's CPU is overrun over 30 minutes?

my computer's OS is windows 7, I would like to do this: when my computer's CPU is overrun over 30 minutes, it will trigger task scheduler's event which is send a email to my email account. I don't ...
5
votes
2answers
2k views

Running Script on Shutdown using Windows 8

Is there any way to execute a Batch- or PowerShell-Script on shutdown using Windows 8 without disabling FastBoot? I know you can add a script using "gpedit.msc", but I found that Windows 8 won't ...
1
vote
1answer
112 views

Powershell pinned shortcut customisation

When right-clicking on the pinned Powershell item on my taskbar, it pop up with tasks. such as run as administrator. Is there a way to add run as accounts to this, looking to add the domain ...
2
votes
4answers
842 views

A decent remote shell from UNIX to Windows? [closed]

I'm on Linux and develop on a Windows 7 box virtualized via VirtualBox. My usual way of developing consists in editing source files from Linux via nautilus/SMB (smb://192.168.1.4/...) then when I'm ...
4
votes
2answers
924 views

Customizing Powershell to look like Github for Windows' shell

I use Github for Windows and usually I use the "Open a Shell" here command which launches powershell with some custom settings. It makes powershell display extra information when I'm inside a Git repo ...
0
votes
0answers
224 views

Share tiles and secondary tiles between user accounts in Windows 8

Our Windows 8 Metro application secondary tiles that we need to share between several user profiles on a single PC (tablet). I was wondering if it is possible to copy secondary tiles (as opposed to ...
0
votes
1answer
176 views

Powershell : set_InnerText function not appearing for XML

$xml contains a xml document $e = $xml.CreateElement("Pass2") $e.set_InnerText ("p2") --> This command errors out $e.SetAttribute("Pass2","p221") --> This works, but is not what I need ...
3
votes
2answers
7k views

Why can't Excel open a file when run from task scheduler?

I wrote a powershell script that opens an excel workbook and runs a macro. When I run that script from PS console, or even from command line using powershell.exe script.ps1, it jus works. When I set ...
1
vote
3answers
1k views

Check whether Windows Updates are being installed

I have a powershell script that’s used by the IT support department for remotely installing software on workstations. The script supports the installation of multiple products (one after another)and ...
0
votes
3answers
2k views

Powershell very slow to open/respond

I am having an issue running PowerShell 3.0 on Windows 7 64-bit. It takes a very long time to open/start when run it. It is also quite sluggish in response to just about anything. I believe this may ...
1
vote
1answer
1k views

removing special characters from entire directory structure

I would like to know whether it is possible to REMOVE special characters recursively in powershell from all files in an entire directory structure? for example if I have a file called: my ...
0
votes
1answer
2k views

How to get the GUID of different HDD partitions?

I was trying with BCDEDIT and DISKPART but that tools give me an ID that is not the GUID Note: I am testing in Windows 7
2
votes
1answer
280 views

How to disable iritating beeping sound in powershell

sometimes I run grep (aka select-string) that has string that occurs too ofter, then powershell goes crazy, sometimes I manage to kill it with ctrl-c, but even then i have to endure irritating beeping ...