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

Running IIS command on remote server via Powershell

I am trying to check if an IIS application pool exists on a remote server using a PowerShell script. The command I am running is: test-path "IIS:\AppPools\DefaultAppPool" If I run this script ...
0
votes
1answer
15 views

PS to list all schemas

This may be simple enough.But since I am new to powershell handling sql script,I am here with a question. After getting connected to a database how can we retrieve all the schema's listed in that ...
1
vote
0answers
17 views

create a log file using powershell

Can someone please help me on how we can create a log file using powershell? I am using this code for log file creation.. # Log file time stamp: $LogTime = Get-Date -Format "MM-dd-yyyy_hh-mm-ss" # ...
-2
votes
1answer
16 views

PowerShell Pros and Cons [closed]

Where I work we are on the verge of implementing Active Directory. One person in particular is touting its ability to be an almost cure-all for our department. He has limited experience programming ...
2
votes
1answer
45 views

Is it in any way possible to uninstall PowerShell from Vista?

Is it in any way possible to uninstall PowerShell from Windows Vista? There is no Uninstall option under Start/All Programs. It's start menu group is actually located under Accessories which is hard ...
1
vote
2answers
35 views

Opening PowerShell at the current working directory from the registry

This question is prompted by a problem I faced while writing this answer. I am invoking PowerShell like this from the registry: C:\Windows\System32\WindowsPowerShell\v1.0\PowerShell.exe -NoExit ...
0
votes
0answers
19 views

Printer Deploy - Remote Machines Win7/XP Printbrm.exe

Curious if anyone else has a solution for the problem I seem to be facing. Have a target collection of computers that is a mix of XP and win7 not caring at the moment about processor architecture. I ...
2
votes
2answers
62 views

how to set PowerShell as default instead of cmd.exe

I'm trying to get PS to open up instead of cmd.exe when I do a Shift+left-click and select open command window here I changed the %ComSpec% system variable and even added on in my user variable ...
0
votes
0answers
16 views

ODBC connection thru SSH

I need to run a script which use odbc thru an SSH port forwarding (tunnels ) . I can do it by interatively running putty.exe first to establish the SSH connection with port forwarding , and then run ...
1
vote
1answer
36 views

Batch create folders?

I'm looking for a way to batch create a folder followed by sub-folders. I'm looking at something like c:\users\user\desktop\sample\1 c:\users\user\desktop\sample\2 etc. Any ideas? I'd prefer ...
1
vote
1answer
36 views

PowerShell Expression interpreter on variables

In response to this question, the original requester wanted to know In PowerShell, is there a way, after typing a long or complicated command, to commit that command into the history buffer, but ...
-1
votes
1answer
23 views

Replacing a string in all config files across machines with a script

I have the below task and I am wondering what would be the best and quick way to do this. I am thinking scripting rather than a C# app but struggling with scripting in DOS. I wanted to use powershell ...
0
votes
0answers
23 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
73 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
25 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
65 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
25 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
47 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 ...
4
votes
2answers
52 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 ...
2
votes
2answers
93 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
1answer
43 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
46 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
52 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
60 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
43 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
0answers
29 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 ...
7
votes
1answer
51 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
50 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 ...
2
votes
2answers
59 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
52 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
67 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 ...
0
votes
1answer
231 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 ...
2
votes
1answer
61 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
72 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
71 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
116 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
0answers
19 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 ...
4
votes
1answer
41 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
101 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. ...
0
votes
0answers
32 views

Finding not corrupt files using hashes with minimum hard disk use [closed]

Today I have one really interesting problem for all SuperUsers. After hard disk crash 80% files are recovered with folders. But still, some files (all different type) that software is saying is 100% ...
3
votes
0answers
68 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
30 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
80 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 ...
1
vote
0answers
42 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
49 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 ...
0
votes
0answers
55 views

Sublime Text Build System for Heroku

I made a build system for Heroku Foreman on Sublime Text 2 (windows 8) { "cmd": ["foreman.bat", "start"], "working_dir": "$project_path" } When I run this in shell, I can just break, and ...
1
vote
1answer
50 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
1answer
41 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 ...
2
votes
1answer
82 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 ...
1
vote
0answers
112 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 2 3 4 5 11