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

Set-AzureStorageAccount - GeoReplicationEnabled parameter will be deprecated in a future release

I get the following warning in powershell for this command: Set-AzureStorageAccount -StorageAccountName $storageAccount -GeoReplicationEnabled $false WARNING: GeoReplicationEnabled parameter ...
0
votes
1answer
174 views

Sysprep.exe fatal error, and can't delete metro app in windows 8 to get it working

Today I used sysprep.exe to rebuild my windows image. But it always said "a fatal error occurred while trying sysprep". Then I went to check setupact.log file , it shows like this I followed this ...
0
votes
1answer
156 views

Automatically retrieve a set of files from all domain computers

Is there any PowerShell script or piece of free or commercial utility software that could be run on a server on demand and which would copy a particular set of files from a particular location on all ...
0
votes
0answers
9 views

automate forefront identity manager 2010 with Power Shell

I have a VM running server 2012 with MS Forefront identity Manager 2010 R2 with the purpose of syncing our on prem AD to azur AD for office 365 Every 3 hours the service runs Active Directory ...
0
votes
1answer
17 views

Why does Console2 return the cursor at weird offsets?

Since I have insufficient reputation to post images, here is a screenshot where I type "quit" repeatedly within ghci. This behavior occurs when using both PowerShell and cmd.exe. The settings for ...
0
votes
2answers
66 views

How to get serial number of drive in storage pool

I have a storage pool in windows 8.1 and notice that whenever I boot the computer, it hangs for a long time in the detecting IDE drives during post. When it finally gets into windows, it shows one of ...
1
vote
2answers
2k views

Change to home directory in PowerShell

At the cmd command prompt, this command will take me to my home directory: cd %UserProfile% At the PowerShell command prompt, the same command produces this error: Set-Location : Cannot find path ...
3
votes
3answers
3k views

multitail for Windows cmd/powershell?

Is there a program like multitail but for Windows cmd.exe or powershell (not GUI)?
1
vote
2answers
432 views

Powershell queries

Is there a command line bash's !$ (match last word of previous command) any shortcut to delete previous word. Ex: cd D:\programs\scrap .<ctrl+backspace> deletes the word 'scrap' Replace ...
3
votes
2answers
2k views

grep in Powershell

What is the mos easy/comfortable way to use Powershells built-in functions to emulate grep like behaviour? In scripts I use something like this dir "*.filter" | foreach-object{ $actfile = $_ ...
0
votes
1answer
360 views

How do I renaming files in a batch with a counter?

I have 14,000 picture sorted into files by year and month but taken with multiple cameras. I want the file name to reflect the date the photo was taken. For example, all pictures taken on October ...
-2
votes
1answer
142 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?
2
votes
1answer
88 views

How to know the file history that has been transferred from pc to usb device or vice versa? [duplicate]

When I want to know that if any usb device that has been plugged in a pc recently, I write this command in Windows Powershell. Get-ItemProperty -Path HKLM:\SYSTEM\CurrentControlSet\Enum\USBSTOR\*\* | ...
0
votes
2answers
50 views

How can I remove all but last 10 characters in a group of files

How can I rename a group of files like admin_ball_126608454.gma another_thing_384157357.gma to ds_126608454.gma ds_384157357.gma
0
votes
1answer
39 views

Rename a file and add a part of the file as the suffix of the file [duplicate]

I have file names like: A_20141001_20141224.txt A_20141002_20141224.txt B_20141001_20141224.txt B_20141002_20141224.txt C_20141001_20141224.txt C_20141002_20141224.txt I want to rename them to: ...
-2
votes
1answer
46 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
20 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
61 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 ...
3
votes
4answers
6k views

Which are the non-x text editors in Powershell?

Are there some editors like emacs, vi/vim, specifically for power shell, if so which are the best? I will have to do some work on windows and I need some unix productivity - which means for me shell ...
1
vote
2answers
2k views

PowerShell script to copy files is having issue with directory path with spaces in it

I have a list of files to copy to/from different locations. Unfortunately, one of them has spaces in the subdirectory. Not all of them have subdirectories, and not all have spaces. This is a ...
7
votes
2answers
3k views

Powershell opening with ridiculously tiny font (about 5) and won't change to new default settings

Powershell is opening with extremely small font (about 5 pts). When I go to Defaults > Font, the setting is a reasonable 8 x 12 pixels but that is not what is showing on the screen. I try changing ...
0
votes
1answer
81 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 ...
1
vote
0answers
105 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 ...
0
votes
1answer
43 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 ...
27
votes
5answers
37k views

Copy and paste in Windows PowerShell

How do I effectively copy and paste input and output in the Windows PowerShell?
102
votes
7answers
76k views

Native alternative to wget in Windows PowerShell?

I know I can download and install the aformentioned library (wget for Windows), but my question is this: In Windows PowerShell, is there a native alternative to wget? I need wget simply to retrieve ...
5
votes
2answers
597 views

Equivalent of bash's Ctrl-r in PowerShell

does anybody knows of a way to have the backward command search feature of bash [Ctrl-r] (and [Ctrl-o]) that are so useful, in windows powershell ? C-r is a more powerful arrow up history ...
1
vote
2answers
321 views

Read x64 registry branch from 7-zip SFX Installer via PowerShell

I want my 7-zip self-extracting archive to run a PowerShell script after it extracts files. To do that, I use method described here: ...
0
votes
0answers
68 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 ...
2
votes
1answer
264 views

need command line to test duplex status on windows NIC cards

this woud be for windows 7 I tried the following powershell command get-wmiobject Win32_NetworkAdapter | foreach-object { get-wmiobject -namespace root/WMI -class MSNdis_macOptions -filter ...
2
votes
2answers
52 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 = ...
0
votes
1answer
28 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
19 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
42 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 ...
1
vote
1answer
112 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 ...
3
votes
3answers
7k views

Powershell Bug in copy/move/rename when filename contains [square bracket characters]?

Please pardon a noob question, but I've been completely baffled by this one. I have a "depositor" directory where user-submitted files arrive, and have no control over the incoming file names. I ...
4
votes
2answers
25k views

Concatenating Variables within Powershell

I'm trying to concatenate two variables within Powershell to form a complete file path and file name to save a text file. I have two variables $Log_path and $Log_name I'm trying to join the two ...
34
votes
10answers
21k views

Equivalent of Linux `touch` to create an empty file with PowerShell?

In PowerShell is there an equivalent of touch? For instance in Linux I can create a new empty file by invoking: touch filename On Windows this is pretty ackward -- usually I just open a new ...
10
votes
5answers
16k views

Delete all files from a folder and its sub folders

I want to remove all files from a folder structure, so I'm left with an empty folder structure. Can this be achieved in either batch or VBScript scripting? I have tried a very basic batch command, ...
0
votes
1answer
85 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
30 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.
1
vote
1answer
140 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. ...
8
votes
2answers
10k views

Is Windows PowerShell as powerful as the terminal of Unix/Linux? [closed]

Is Windows PowerShell as powerful and efficient as Linux' terminal? People offline tell me, without explaining much, that Windows PowerShell is an attempt to make Unix administrators feel more ...
8
votes
4answers
5k views

Windows PowerShell equivalent to Unix/Linux `pwd`?

In follow-up to the cmd.exe question, what is the PowerShell equivalent to echo %cd%, or Linux/Unix pwd?
0
votes
1answer
150 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
vote
1answer
34 views

Grabing Mailbox Stats : How can I look at multiple OUs?

I have this Powershell code that grabs the mailbox stats from one OrganisationalUnit but how could I grab it from two others without running the code again seperately. How would I create an array of ...
0
votes
0answers
54 views

Powershell Network Copy Script very slow

We have a main files server for a local office, I placed a ESXI host in one of our data centres, I used the recursive copy function to create a small powershell script, and scheduled this for 9pm. For ...
2
votes
1answer
213 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 ...
-1
votes
1answer
142 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 ...
-1
votes
1answer
65 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 ...