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
1answer
13 views

PowerShell: find line but include proceeding and preceding line(s)

This is a conceptual question that I have only briefly thought through my head. I have idea how I might do it but it seems more complicated than I think I will make it out to be. A common need is for ...
0
votes
0answers
4 views

How do I regain connectivity to a Windows Server after calling Powershell cmdlet Remove-NetFirewallRule?

I have some servers on AWS cloud. I accidentally invoked the PowerShell command Remove-NetFirewallRule and this has completely locked me out of the server. The server is joined to a domain. I have ...
1
vote
1answer
35 views

Self destruct directory

I would like running a script in a directory and then delete the directory, sub-directory and files. If(Test-Path -Path $var_InterventionManuelle) {Remove-Item -Recurse -Force ...
1
vote
0answers
43 views

How do I gain access to my C: Drive after completely locking it down?

I know the title might seem completely ridiculous but please read this before being biased. Okay, so I got myself into a real squeeze. I installed windows 10 technical preview for Enterprise on a ...
1
vote
0answers
28 views

Automating Skype Calls on Windows [on hold]

A colleague of mine created a npm package called Skypeit for automating phone calls with skype. It leverages applescript for the integration on OSX. I would like to have the equivalent on Windows, is ...
0
votes
1answer
27 views

Powershell script to open random video

I was looking for a way to open random video file in my folder which has about 400 videos (20 videos in 20 subfolders). I found a powershell script and managed it to work, but every time I run it I ...
0
votes
2answers
35 views

Use a variable inside a powershell string

I've got this currently on a single line in Powershell ISE Start-Process -filepath "C:\Powershell-Backup\disk2vhd.exe" -argumentlist 'C: \\Computer1\ServerBackups$\' + $ComputerName + '\' $JobTitle + ...
0
votes
0answers
21 views

Powershell Refresh Script

This is a fairly simple script, but it doesn't always work. It worked once today, the first time I ran it. I believe it isn't opening the files in the path I specified on subsequent runs. I'm not ...
0
votes
1answer
35 views

Tool That Converts Any Batch File Into Powershell

Is there a tool that can convert a batch file into a powershell script? My issue I'm having with batch files is that they are not running from the task scheduler, unless I stay logged in, and I'm ...
-3
votes
0answers
7 views

How do I retrieve connected VMs to a virtual switch in Hyper-V using PowerShell? [closed]

How do I retrieve, using PowerShell, which VMs are connected to an specific Virtual Switch in Hyper-V? I'm running Windows Server 2012.
0
votes
1answer
21 views

Invoke-item equivalent in git-bash?

Powershell allows you to open a GUI folder with the invoke-item command. Say I'm in C:\Family\Desktop, the command "invoke-item adam" allows me to open a GUI version of the adam folder. I've tried ...
0
votes
1answer
15 views

setting up variables and the results from a function within a string - all as a string in powershell

I am new to this and could use some assistance. I have the following function and trying to add the result from the function into the strings below. What am I missing to accomplish this? I just want ...
0
votes
1answer
12 views

How to remove a picturebox from a powershell GUI after it has been added?

I am creating a powershell tool that performs a specific migration of program data. One step I need to perform is to check whether SQL server can write to the specified file locations. I have a button ...
2
votes
2answers
26 views

Wait for process to exit using powershell

I had a little program in F# (similar to C#), that gets processes by name, then filters the particular one by its path and waits for it to exit: let processes = ...
1
vote
1answer
88 views

Loop through files and remove part of filename

I need to remove the first 3 chars of every file in my directory. Here is my code: Get-ChildItem "D:\New Folder" -Filter *.txt | foreach-object -process {rename-item -path $_.FullName -newname ...
2
votes
0answers
25 views

What's the difference between Remove-WindowsFeature and Uninstall-WindowsFeature? [migrated]

What's the difference between Remove-WindowsFeature and Uninstall-WindowsFeature? I've used Add- and Remove- on Windows 2008 R2 boxes, but there is now an Install- and Uninstall- which according to ...
0
votes
1answer
15 views

Using powershell, how do I extract the thumbprint from an SSL Certificate without installing it?

Every example I've found on StackExchange, and other internet forums, etc all tell me how to get the thumbprint from a certificate already installed into a certificate store. Alternatively, the ...
0
votes
2answers
15 views

Powershell - Start Process on Different Drive from Batch CMD

Problem: From the CMD or Batchfile, calling powershell and starting a process from a different drive or the -FilePath is failing.
2
votes
1answer
47 views

Focus IE window in powershell [closed]

My code: $ie = new-object -com "InternetExplorer.Application" $ie.navigate("http://localhost") $ie.visible = $true $ie.fullscreen = $true However, after fullscreen, the window still appears behind ...
0
votes
1answer
49 views

Restart a computer at a given time with PowerShell

I'm looking for a way to restart a computer with PowerShell (Restart-Computer), at a given time (Example: 03:00AM). The PS-Script itself will run at a random time, when the user executes it, so it's ...
-1
votes
1answer
33 views

PowerShell script to retrieve local group member data

I am trying to pull out from hundred of servers information into Excel spreadsheet about all existing local groups including their members with account status. I have a server list - servers.lst for ...
0
votes
1answer
25 views

I've placed a binary in my $PATH, but when I run it from powershell it gets its own directory instead of the current directory

I’ve installed Hugo (a static website generator) on my Windows 7 system by placing it in a directory in my $PATH. When I try to run it, regardless of the directory I’m in, it's run in its own ...
0
votes
0answers
23 views

WmiEvent for any usb device

I am following this answer, which contains Register-WmiEvent -Class win32_VolumeChangeEvent -SourceIdentifier volumeChange and $newEvent = Wait-Event -SourceIdentifier volumeChange This works ...
0
votes
0answers
18 views

Get calender entry from public exchange calendar with powershell

We have an MS Exchange 2010 Server named EX01 and a public folder based calender named VenueEvents. I open a remote connection from Powershell to the server using this code: $cred = Get-Credential ...
0
votes
1answer
24 views

Checking WinSCP connection status in PowerShell script

I have a script that get files from one location to another. My script works fine. However I'd like to check first for "connected sessions". With SSH.NET PowerShell module I checked this with: ...
-1
votes
1answer
41 views

Powershell to compress files and send email

Powershell to compress files and send email. I want to 7zip backup file and send as an email. Below i have done till now which will read text files and send as email. Instead i want to send all the ...
-1
votes
1answer
47 views

How to open a firewall port in Windows using Power Shell

I would like to know how to open a firewall port in Windows by using Power Shell.Could anyone write a script for opening a firewall port.I saw a similar post on ...
1
vote
1answer
51 views

Powershell search-string inside a variable (not text file)

I am trying to search for a string called "Hostname" from a variable "$a" which stores the output of "systeminfo" command but ran into issues. I am using "system-info" to gather a bigger set of data. ...
-2
votes
1answer
114 views

Powershell stopped working

I get the following message in my system 7, "powershell stopped working", very often. I tried a system scan and everything is ok. What is causing this message? How do I solve this?
0
votes
1answer
58 views

Powershell | DownloadString | External website | Return

I'm a totally powershell newbie, so please be indulgent ;) I'm trying to write a script where a machine check an external website waiting for a the word: "test" to execute a download. The things goes ...
0
votes
1answer
44 views

Change the default Mouse Pointer Colour on boot in windows 8.1

How do I change the default (White to black) Mouse Pointer Colour on boot in windows 8.1
0
votes
3answers
46 views

Cannot change directory with cd in DOS using Win7

I would like to change my Present Working Directory in DOS (I am running Win7 professionnal). When I perform a cd D:\, nothing happens: Microsoft Windows [Version 6.1.7601] Copyright (c) 2009 ...
0
votes
2answers
86 views

remote file copy in windows

I am running an automated process on one particular machine, variously a Windows 7 box or a windows Server 2012 box. These boxes are connected to a file server over the network. The network is a ...
0
votes
0answers
53 views

How do I access gzip-compressed data from a PowerShell Invoke-WebRequest command, when the “Accept-Encoding: gzip” header is set?

I'm learning about response compression in IIS and I'm testing my configuration with various tools. It appears that several of these tools either auto-decompress the response, or always send the ...
1
vote
1answer
52 views

Powershell 2.0 Enter-PSSession cannot get New-PSDrive working

I have a remote computer which I can Enter-PSSession successfully. When I execute: New-PSDrive -Name "G" -PSProvider Filesystem -Root '\\fileserver\apps\etc' I get the following error: ...
0
votes
0answers
20 views

Get-childitem via PSSession

can someone explain me this behavior? I create a test folder, lets say c:\tmp\testing\folder1 I disable inheritance on folder testing, and remove all ACL entries. So i get "Access denied" when i ...
0
votes
0answers
20 views

Finding a short cut to "Connect To Network

Is it possible to create a shortcut for Network --> Properties-->Connect to a network in Windows 7? Connect to a network is available in Control Panel\All Control Panel Items\Network and ...
0
votes
0answers
26 views

install cad program (Solvespace) no installer - on Win7-32 ?

Do I run PowerShell msi, exe.,on command line ? any advise where to start would be helpful. I am used to downloading programs with an Win installer. also I am a PC novice.
-2
votes
1answer
73 views

pulling specific columns from various excel sheets and putting them to a new worksheet [closed]

I have a report that I do and at the moment it is very tedious. I have 6 separate excel reports with different information in them. I create a new report by going into each work sheet one at a time, ...
4
votes
1answer
136 views

Update Driver Software from command prompt

I'm looking for a way to automatically install missing drivers on newly installed machines. All the machines are the same brand and model, so I created a shared folder that hass all the drivers in it. ...
0
votes
0answers
58 views

Powershell Start-Process fails to start when -Credential argument is added

If I run this in powershell, Start-Process "c:\Python27\python.exe" -WorkingDirectory "c:\wd" -ArgumentList "-m SimpleHTTPServer" It can start the python process as expected However when I add ...
0
votes
1answer
65 views

Find highest possible screen resolution from command line

With Powershell, I can request the current screen resolution. this is not what I'm trying to do. I'm trying to find the maximum resolution I can set the screen to (slider all up). Is this even ...
1
vote
1answer
53 views

Returning user password expiry date - Powershell

I'm working on a command to pull users and the date/time that their password will expire. Trying to make it look somewhat decent. I feel like this should work, but it's not working as planned. Can ...
1
vote
0answers
17 views

PowerShell have Tab only fill in partial matches instead of first selection

I'm having trouble adapating to the behaviour of PowerShell tab completion from bash tab completion and wondering if there is a way to change it. In PowerShell when I press tab it expands to the ...
3
votes
1answer
100 views

Restart-Computer and hold script

I'm running a Powershell script that requires a reboot in the middle of the script. After the reboot, the script is executing some commands (that can't be executed before the reboot!). I'm rebooting ...
0
votes
0answers
42 views

PowerShell issues with spaces in directory names

PowerShell has issues with spaces in directory names. I am trying to execute a file in the same directory as the PS1 script like so: .\getGravatarsForGource.pl It works fine when the directory ...
2
votes
1answer
91 views

Windows PowerShell Script to convert a folder of Word Docs to PDF

So I already have the basic code to do this. i.e. convert a folder of word docs to pdf. # Acquire a list of DOCX files in a folder $Files=GET-CHILDITEM ‘C:\Users\Ashley\downloads\articles\*.DOC’ ...
0
votes
0answers
24 views

Open Powershell ISE from Windows 8.1 start button context menu [duplicate]

I really like the ability in Windows 8.1 to right click the Start button and select "Windows Powershell" or "Windows Powershell (Admin)" to open those command windows. I'd absolutely love it if I ...
0
votes
2answers
81 views

How do I open a command prompt as a regular user (not an adminstrator)?

I'm trying to fire up a regular command prompt to test the limitations of certain commands. However, whenever I open the Command Prompt from the start menu, it automatically runs as Administrator. If ...
0
votes
0answers
41 views

GnuWin32 / sed unexpected behavior in Powershell

I am using GnuWin32 tools on Windows Command Line/Powershell. What is see: 11:15 enlil D:\Users\x> Get-ChildItem .gitconfig | sed "s/ */ /g" D i r e c t o r y : D : \ U s e r s \ x M o d ...