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

1
vote
0answers
40 views

How can I make cygwin commands a priority over built in windows commands?

If I run ls in powershell the windows built in ls function is run. how can I make cygwin ls run instead? I've tried moving cygwin/bin to top begin system path variable, but that didn't work. is ...
0
votes
1answer
112 views

Enable local administrator account for clients from server 2008

I ran into a problem with one of my client , its local administrator account is disable, also I can't log in this machine with its domain user (because of this problem), now I wanna change its ...
0
votes
0answers
270 views

How to copy file names matching a pattern in powershell

I am new to powershell. I need to copy the whole folder structure from source to destination with filenames matching a pattern. I am doing the following. But it just copies the content in the root ...
0
votes
1answer
158 views

Piping with PowerShell in Office 365 Exchange and on-premises AD

We have a local AD domain synced with Exchange Online in Office 365. I am trying to use PowerShell to get information that I need but keep getting an error and can’t seem to get the commands to work ...
1
vote
1answer
36 views

When should I use the “Get” or “Find” verbs in PowerShell?

I've been writing some basic PowerShell scripts for a while now and want to stick to the appropriate naming conventions by starting the name with approved verbs. I can't see the difference between ...
0
votes
0answers
112 views

Adjust Microphone Volume After Launching Application

I currently have a USB headset plugged into my computer and its mic volume is set to 82%. Whenever I launch the game Titanfall, my mic's volume is raised to 100%. I am trying to find a way to ...
1
vote
1answer
60 views

I want to read a value from a text file and compare it with a number

I am using windows powershell. I want to retrieve a number which is stored in a text file and compare it with some other number using a shell script. If I use $x=$(cat value.txt) it says "command not ...
0
votes
1answer
83 views

How should this HTML be formatted when entering it into PowerShell?

We will be moving to Office 365 next month and are in the process of fine-tuning some small Exchange Online related issues. The last problem I am trying to solve is getting our organization's logo ...
1
vote
1answer
91 views

Command Line Parameters in Powershell

I am using a program called sonar-runner that you execute from the commandline, and you can pass optional parameters. For example in the normal windows commandline tool a call may look something like: ...
0
votes
2answers
134 views

Powershell: The local farm is not accessible. Cmdlets with FeatureDependencyId are not registered

I am trying to run a PowerShell script from a windows batch file. This is a SharePoint related script that uses Import-SPData. This works without any issue when using USERA's login. However, if I try ...
0
votes
1answer
63 views

Is there a way to find out if a Windows 7 workstation has updates turned off in the control panel?

I have a domain with a group policy to run updates every night at 3AM. If the computer is turned off, the next time a user logs into the computer, the updates are downloaded. When the users shuts ...
1
vote
0answers
119 views

Can't create a COM object in a powershell script running as a scheduled task

I have a powershell script I'm trying to run as a scheduled task. Its purpose is to perform a nightly export from an Access database, then upload the exported flat files to an SFTP destination. The ...
1
vote
2answers
40 views

Pipe at the command line

In the blog http://blogs.msdn.com/b/zainnab/archive/2007/07/09/grep-and-sed-with-powershell.aspx I found a replacement for sed implemented as PowerShell script. I don't want to depend on the ...
0
votes
0answers
29 views

ovftool library usage in standalone app

I am trying to create an application which will deploy VM on vSphere, right now I am using PowerCLI with ovftool, but sometimes I have deploy from computer which do not have PowerCLI neither ovftool ...
0
votes
1answer
52 views

(Windows Powershell) How to open a globally defined file with a certain application?

I've added the C:\Windows\System32\Drivers\etc\ directory, which contains the windows hosts-file, to my PATH environment. So if I start the shell at some arbitrary location (C:\ for example) and ...
1
vote
1answer
210 views

Disable IE 9 Addon on IE startup, w/Powershell and then Enable on IE exit

I know we can disable all addons/exts when we start IE using the "-extoff" switch. But is it possible to disable a single IE addon from a shortcut start or through a script? And then re-enable the ...
1
vote
1answer
668 views

Calling PowerShell functions in another scripts

I have a script with a number of functions (not just functions but also other code). I would like to create another script that uses one of the functions in the main script. Here is a sample of what ...
1
vote
1answer
35 views

Launch Script for Windows7

Hey guys hopefully I can thoroughly explain what I'm trying to do here! LOL I have a dual display Windows 7 PC and what I am trying to do is launch 2 different programs on boot, and I want one to ...
0
votes
1answer
125 views

How can I programmatically copy an incoming VPN connection profile to a Windows 7 computer?

In Windows 7, I can create an incoming VPN connection, essentially turning Windows 7 into a VPN server. Is there any way that I can copy this setup from one Windows 7 PC to another? For instance, if ...
-1
votes
1answer
73 views

Execute command prompt file (.cmd) from within a PowerShell script?

What command do I need to put in a .ps1 file to execute setup.cmd and make it a forced install? I've tried to execute this command in powershell and its working: PS C:\> c:\setup.cmd ...
1
vote
2answers
2k views

Using the Windows 8.1 command prompt to view Windows activation key

I am not able to access my control panel, probably due to some corrupt system files. And to request help from Microsoft, I need to give them my Windows 8.1 product key. So is there any way I can ...
1
vote
1answer
70 views

PowerShell ISE doesn't flush stdout

I'm having a little problem when running a console program in PowerShell ISE: when the program writes out a line in portions using flush, PowerShell won't show the line until the program writes a line ...
2
votes
2answers
82 views

Name “wmplayer” is not recognized as an executable file

I cannot run wmplayer from either cmd or PowerShell. My OS is Windows 7 64 bit. I can do it using start wmplayer but I cannot use parameters. Please, help me to handle it.
1
vote
0answers
125 views

Why does FFmpeg append blank black video to the end of my MP4 files when compressed from MOV?

I have several large MOV files that I want to compress to MP4. Unfortunately, when I use FFmpeg, it appends lots of black (blank) video at the end. (The destination file is longer than the source ...
0
votes
1answer
136 views

Set proxy settings and proxy authentication

I've asked this question on StackOverflow but it's not getting lots of attention, I thought it would be better to port it here: I'm new to PowerShell, and I'm tired of changing proxy settings and ...
2
votes
2answers
49 views

How to make a single user's calendar private?

We're using Exchange 2010. A few weeks ago I used the following PowerShell script to give everyone access to everyone's calendars: $users = Get-mailbox $users | ForEach-Object ...
0
votes
1answer
105 views

How to add/remove lines from the hosts file

I'd like to add and remove hosts file entries at a regular interval. I believe the easiest way to do this is powershell and task scheduler. So how do you add/remove hosts file entries?
0
votes
1answer
617 views

Call PowerShell script from Excel

Excel 2010 I'm trying to call a PowerShell script from a macro in Excel. I have seen a number of examples along the lines of: retval = Shell("powershell ""C:\MyTest.ps1""", 1) When I try to use this, ...
0
votes
0answers
27 views

Shell hangs after passing STDIN to EDITOR with -w parameter

I want to edit svn's svn:ignore property: svn propedit svn:ignore . This doesn't work: None of the environment variables SVN_EDITOR, VISUAL or EDITOR is set, and no 'editor-cmd' run-time ...
1
vote
1answer
60 views

Powershell script with multiple msiexec calls [closed]

I am having problem with multiple msiexec calls in my PS Script msiexec /package $msi1 /l*v $logfolder\log1.log /qn msiexec /x $msi2 /l*v $logfolder\log2.log /qn msiexec /i $msi3 /l*v ...
1
vote
3answers
148 views

Is it possible to log off windows 8.1 on wireless mouse disconnect?

I'm running a laptop with windows 8.1, I often run it in public places where sometimes I leave it for a few minutes and I started to think would it be possible to log off and log on when I switch off ...
1
vote
2answers
158 views

why cant we maximize the command prompt but whereas we can run the powershell maximised

According to this answer windows command prompt cant be maximized, but what makes the windows to view maximizing through powershell, what does the difference while maximizing in windows powershell and ...
2
votes
4answers
88 views

In powershell, is there a way to copy to last directory on `pushd`'d stack?

In Windows PowerShell (and CMD and bash) it would be nice to pushd and then copy to the last directory I was in. ex: > pwd Path ---- D:\Some insanely long\path I really\ don/'t want to ...
0
votes
1answer
114 views

PowerShell - IF statement case insensitive?

I am trying to write a PowerShell script that will cycle through the ProxyAddresses for all of my AD user objects. If a user has a SMTP address with USER@DOMAIN.LOCAL, I want it to check if they also ...
1
vote
1answer
370 views

Checklist to configure programs to (not) run at startup in windows 8

I'm asking specifically for Asus Splendid, I'd like to run it whenever I want so that it does not start every time I start windows. I know it's a program that is started because the screen looks ...
1
vote
1answer
57 views

Setting the Taskbar buttons to combine when full via PowerShell

Is it possible to set the Taskbar buttons option to Combine when taskbar is full via a powershell command? I've looked at Set “never combine” in Windows 7 using the registry? but I'm after a ...
0
votes
1answer
70 views

Separate input and output panels

I've just started playing around with PowerShell. I'm following a tutorial from pluralsight. The tutor uses PowerShell ISE and he has 3 panels in it: Script editor Input console Output console On ...
1
vote
1answer
117 views

Unable to SSH to my virtual machine via Windows Power Shell ISE

I have a Linux VM guest running in my vmWare host that I want to access using Windows PowerShell ISE. I normally can SSH to my VM, but I cannot with Windows PowerShell ISE. When I try to do SSH to my ...
0
votes
1answer
75 views

Unable to SSH to my virtual machine via Windows Power Shell ISE

Well, I have a Linux virtual machine running in my vmWare. And I would actually love to use my Linux in Windows Power Shell. So I usually use it by doing an SSH to my VM. Recently I came across the ...
2
votes
2answers
290 views

Windows Task scheduler Winlogon events - logout not enough(?)

I created a powershell script that I want to run on every logout / restart / shut down. For trigger I set a custom event: Log: System, Source: Winlogon, Event ID: 7002. I found the above event id ...
1
vote
2answers
2k views

PowerShell List of distribution groups and members? (Office 365)

I'm looking for a way to export a list of distribution groups along with the members of each group via PowerShell on Office 365. I've found scripts that export a list of users and the groups they ...
0
votes
2answers
120 views

How to pipe a list of domain names into NSLookup using powershell?

I have a list of domain names in excel (100 in total) that look like the following: domainnameone.com otherdomainnametwo.com etc' I need to take this list and add exceptions into our firewall ...
0
votes
0answers
50 views

Need a PowerShell analog to the following command

I Need to repeat the following shell command on a windows server 2012 that uses powershell. Found that start command was nearly the same but I need it to be powershell like. The command (it runs in ...
0
votes
1answer
321 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
57 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
742 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
105 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 sub folder in each destination folder and place files ...
1
vote
1answer
78 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
146 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 ...
0
votes
1answer
99 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 ...