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
0answers
29 views

Trying to rename large amount of .doc files based off first line or so of text

I was attempting to help a friend, who had a bunch of data recovered, but the meta data was lost. As most of it is articles or recipes, she believes the title or first line or so of text will be good ...
2
votes
1answer
23 views

Run executables in PowerShell without typing the file extension

I've been using PowerShell as my console on my desktop for a while now. I'm still pretty new to it, but I'm comfortable. I just got a laptop that I started using, but PowerShell acts differently ...
0
votes
2answers
39 views

Find folder without certain file in powershell

I have subfolders, and subsubfolders. In the subsubfolders, I want to find all subfolders without a file named PKA.dump. Can this be done in powershell? The subfolders go from Angle1, Angle2, etc up ...
4
votes
3answers
301 views

How can I delete over 2,000,000 files in a single directory efficiently?

I have over 2,000,000 (that's right, over 2 million) files in 'Temporary Internet Files'. This predicament is the result of a scheduled task that runs a script. After installing Visual Studio, it has ...
0
votes
1answer
8 views

Hyper-V port access lists do not allow traffic past gateway

A situation: The local network of 192.168.0.0/16 is split into many subnets, and routers are in place. A Hyper-V hosted virtual machine is located in a 192.168.X.0/24 subnet. The task was given to ...
4
votes
2answers
234 views

Get-ChildItem | tree gives me a wierdly formatted tree

The following input: PS STG:\> Get-ChildItem | tree Gives me Folder PATH listing for volume Data Volume serial number is 6576-C540 D:. ÃÄÄÄAPK ÃÄÄÄAssets ³ ÃÄÄÄAnimations ³ ³ ...
0
votes
1answer
90 views

How to copy and rename a file from one folder to another using Powershell?

I want to copy and rename a copied file. The file extension is ".ini". I have multiple folders (Banks) with years 1985-2007. Each of these folders (1985-2007) contains cfgfiles folder that contains an ...
0
votes
2answers
723 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
1answer
29 views

getting 9th column of data from multiple files and dumping it all into new file

OK guys, I have 24 subfolders, named Angle1, Angle2, etc up to Angle24, each with a file called output.txt. Note that these folders have subfolders which I want to ignore. Is there a way to loop ...
1
vote
1answer
25 views

Powershell listing size of files

I have 3600 files named PKA.dump One of these files is not the right size. They should be above 500bytes, but one is below 500. Is there a way to check all subsubfolders and find the one file named ...
12
votes
3answers
34k views

How can one show the current directory in PowerShell?

I'd like to have the current working directory show on the powershell command line, as would be done in a (for example) CMD prompt. How can I do so?
12
votes
7answers
24k 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
0answers
37 views

powershell script extract multiple .gz file

would you please help me in this , I have multiple files .tar.gz and i need to extract them , i am able to extract the File.gz incase i have one file using the below script , please let me know how ...
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 ...
0
votes
1answer
50 views

Looping through files and collecting data

Ok, I have a problem that I think you guys can help with. I have 24 folders. Labeled Angle1, Angle2, ... , Angle24 Each folder has a file name output.txt In each file named output.txt, I want to ...
0
votes
1answer
20 views

Executing command in many subfolders in windows powershell

I am in a folder with 24 subfolders. The subfolders are named Angle1, Angle2, ..., Angle24. In each of these subfolders, I want to perform this command: Get-ChildItem PKA.dump -r | Sort-Object $_ | ...
0
votes
0answers
14 views

Get-ChildItem recursive that matches regex patterm and rename the item

I am trying to get child item recursively that have " (1)" and I want to remove this part. Here is where I got so far but it throws an error. Please help. Get-ChildItem -recurse | Where{$_.Name ...
0
votes
1answer
12 views

powershell filter to remove .pdf extension in the name of a file

I am trying to use powershell to get all child elements in a folder the code I am using is Get-ChildItem -Recurse -path C:\clntfiles this code gives output like Mode LastWriteTime ...
-4
votes
0answers
23 views

Any way to delete this folder I lack permissions to without using a live linux? [duplicate]

So, ages ago I installed this DVD burner called "DVD Maker." I immediately deleted it and forgot about it until my hard drive filled up. So I'm looking for things to delete and there's the DVD Maker ...
1
vote
1answer
5k views

How to fix this WinRM error? (Set-WSManQuickConfig error)

On Windows XP Pro SP3, when I run Set-WSManQuickConfig (after agreeing to the new settings), I get this error: Set-WSManQuickConfig : <f:WSManFault ...
3
votes
1answer
10k views

Office365 Exchange: Cannot open shared two calendars in Outlook

The problem: Outlook won't open the calendars on another user's mailbox and and a room mailbox, even when users have permission. Note: This problem is affecting more than one account on more than one ...
0
votes
1answer
25 views

Setting registry permissions with Powershell

I have a registry key that I need to take ownership of and then set a permission set on. I'm able to take ownership, but when setting the permission, it only applies to the very top level of the ...
3
votes
1answer
4k views

What is the Start Screen Control in Windows 8.1 Enterprise

I have read different things on the new Windows 8.1 Enterprise RTM. One of the feature is the Start Screen Control. Start Screen Control: This feature allows you to control the look of the Start ...
1
vote
1answer
43 views

Different results between “PowerShell ISE” and “Run with PowerShell”

I have two simple one line "scripts". They check how old are certain files in a certain folders. One displays the output to the screen and the other writes the output to a text file on the desktop. ...
1
vote
3answers
57 views

How to combine two separate powershell commands

I have several hundred folders that all contain a sub-folder named "Bid Documents". I need to change the ACL permissions on every instance of those "Bid Documents" folders. Is there a way to ...
1
vote
2answers
50 views

Need to rename many very long file names with variable

My company gets a list of files every day that we need to process and the file names are almost impossible for our system to deal with. Is there a way to rename these files? I am new to any type of ...
2
votes
2answers
3k views

How do you install .net4 on a Server 2008 r2 machine through psremoting in powershell?

I need to write a script that installs .net 4 remotely using powershell to a group of Server 2008 R2 machines. I based my script off of ...
0
votes
0answers
57 views

.NET Framework 4.5.2 on Windows 7 w SP1 not showing on Window Features List

I've successfully installed .NET Framework 4.5.2 on a Windows 7 w SP1 laptop, in preparation for upgrading to Office 2013 Professional. Installation of Office 2013 still saying I need Internet ...
0
votes
1answer
23 views

Enabling Active Directory Module for PowerShell via command line

As a final step in my Win7 MDT task sequence, I would like to move each computer from the staging OU to the regular OU (so GPO's can be pushed). My deployment techs have proven less than reliable on ...
1
vote
6answers
2k views

PowerShell not displaying Unix colors

I use various Linux programs on my Windows machine; some of them have colorized output. GnuWin32 and so forth. However, Windows PowerShell does not support Linux colors; it gets a message like ...
0
votes
1answer
2k views

Powershell File Rename Date/Time

I have used a script from a previous post and modified it slightly: Get-ChildItem "c:\test\*.txt" | ForEach-Object { Rename-Item $_.FullName "$BackupFolder$($_.BaseName -replace " ", "_" ...
0
votes
0answers
17 views

How can I input password to manage-bde -pw option via windows powershell

I am trying to encrypt Data volume (for example E:) with the following command: manage-bde -protectors -add E: -pw When I execute the above command, it will ask for the password, so I entered it. ...
0
votes
0answers
11 views

Powershell - Set-alias doesn't accept paramters - python

Following this tutorial i want to set an alias for python autopep8. the syntax described is. Set-Alias gs Get-Service <enter> So o copy that format i have done. PS C:\Users\sayth> ...
1
vote
1answer
21 views

How to create a script that launches a random video file from the folder

So, this is a weird problem. But basically, my nephew likes watching cartoons on my computer sometimes. And that worked well. OVer time, his cartoon folder grew up. Here's the problem: he wants to ...
1
vote
1answer
46 views

How to silently install the Microsoft Monitoring Agent

I am trying to install an .exe application (Win32 Cabinet Self-Extractor) silently from command line using this PowerShell command: Start-Process -FilePath "C:\Temp\MMASetup-i386.exe" -ArgumentList ...
1
vote
1answer
202 views

Internet Explorer: Set homepage for all users without GPO

I'm looking for a way to set the homepage of Internet Explorer (and possibly other browsers) for all Users through command line/Powershell, or any other method that doesn't use the domain policies ...
30
votes
4answers
35k views

have Powershell get-childitem return files only

I'd like to use get-childitem recursively, but only have it return files not directories. The best solution I have just doesn't seem natural: gci . *.* -rec | where { $_.GetType().Name -eq ...
1
vote
1answer
45 views

Windows-8 how do I write a script to change the resolution?

I have a yoga 2 pro that comes with a high resolution display (2k I believe). This sometimes causes issues with programs not scaling properly which for the most part I can ignore. However I also ...
2
votes
1answer
30 views

Determine the Size of a Network Folder

I want a PowerShell script to get the size of a network folder (\\pmintl.net\rbsdata\SPA_BB01) approximately 100TB in size with lots of subfolders. I've tried various scripts without any luck (below ...
0
votes
1answer
19 views

Scripting Shell Settings

I really hate manually setting up cmd and powershell cmd shell properties like window height/width, font, coloring, enabling Quick Edit. Doe anyone know if there a script I can run to set things up ...
0
votes
4answers
42 views

Powershell parse object / string

Learning powershell, trying to find out how to parse the first value from this resultset: IPAddresses ----------- {10.60.50.40, fe80::5ddf:a8f4:e29c:b66} Normally I would just look it up, however, ...
4
votes
2answers
5k views

A command like Linux `tail` in PowerShell?

How can I replicate the behaviour of Linux's tail in PowerShell? I'm running an application that writes a log file (error.log) and I would like to see the last lines from it as well as keep the ...
0
votes
1answer
23 views

Get Notified of Errors in Windows Event Log

I wrote a powershell script to make a database dump that I plan on having run nightly with Windows Task Scheduler. It outputs to a log file so I can make sure everything is working, but I want to be ...
1
vote
1answer
31 views

Copy Command with “%” in path name

I am trying to write a bat file to copy some files into a new directory (which exists). Here is my command: copy ".\050-9800-JJJ-DSC-BAW-MEE-00019-01*.pdf" "T:\201201.00 TCO - Tengiz, ...
5
votes
1answer
175 views

Powershell: A variable within a variable; Variableception

So the easiest way to explain my problem is for me to show you this simplified version of what I'm trying to do: PS C:\> $a = 'hello' PS C:\> $a hello PS C:\> $b = '$a world!' PS C:\> $b ...
18
votes
5answers
14k views

Setting $HOME in PowerShell

How do I change my default home directory to "C:\Users\khornsby" for every time I open powershell? I am running Windows 7. Below is info about the state of my environment. Windows PowerShell ...
0
votes
1answer
38 views

Generate an error log from Powershell

I created a script to assist in mass editing permissions inside an extensive folder structure, based off a list inside a CSV file. The script works as expected, but for several of the folders, I know ...
0
votes
2answers
24 views

“Migration Assistant” for windows?

I'd like to migrate system settings and installation installed software all personal data users from an old windows 8.1 box to a new one. Basically replicate the awesome Mac OS migration ...
3
votes
1answer
52 views

Administrator denied access to folder, impossible to see/change owner

I have a folder which was generated by MSBuild, app.publish. Often, my build script fails to delete it, complaining that it does not have the necessary permissions. Today I tested this outside of the ...
0
votes
2answers
5k views

How to reset TCP/IP on Windows 8.1?

The following netsh command is not working on Windows 8.1. netsh int ipv4 reset It give “Access Denied” error and it is a VERY known issue, many people complaining about it all ove online forums. ...