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

Issues automating printer driver update (printer settings) and printer preferences in Win7, using a PS,cmd,vbs,etc script?

WMI can do it, but I have an issue, PCs are on, but logged off. If I try to run: wmic /node:%strIP% printer where DeviceID="lp1" set DriverName="Lexmark Universal v2" It fails with a message about ...
2
votes
0answers
73 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 ...
1
vote
2answers
3k 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 ...
4
votes
1answer
2k 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
1answer
42 views

Retrieve internet proxy server address via PowerShell

I have to retrieve the proxy server address and port via PowerShell, so I can use the Invoke-Webrequest -uri http://some-site.com -Proxy command. The expected output should looks like ...
0
votes
1answer
29 views

adding the cwd / pwd / (.) to the path in powershell

So I have a program I'd like to run in Windows PowerShell. In cmd I just type in script.cmd and it'll run the script. In PowerShell I apparently have to do ./script.cmd. BASH behaves similarly by ...
0
votes
1answer
60 views

How to add/delete rules in Windows Firewall [closed]

I need to implement a tool which adds and deletes rules in Windows Firewall. The rules can be inbound or outbound, forbidding communication on specified protocols, IPs and ports. I am having trouble ...
2
votes
0answers
79 views

How do we get statistics from a continuous ping in PowerShell?

In Windows command prompt, when you Ctrl-C out of a continuous ping, the terminal will display the statistics: Ping statistics for ::1: Packets: Sent = 6, Received = 6, Lost = 0 (0% loss), ...
0
votes
1answer
55 views

Equivalent of wevtutil in powershell?

wevtutil is a command in cmd for displaying Windows logs in different formats. What is the equivalent cmdlet in Powershell?
0
votes
1answer
77 views

why remote powershell session dose not need password

why remote PowerShell session dose not need username and password? this is very terrible because I feel anybody can connect remotely to my server. I use negotiate authentication method and server ...
1
vote
2answers
68 views

Stop/start a Windows service with a specific path?

I would like to create some scripts (Windows Batch or PowerShell, whichever will work) that can stop and start services that have their binPath in a specific folder. It will speed things up when ...
3
votes
1answer
185 views

How can I install .NET 4.5.2 via PowerShell DSC?

I can install .NET Framework 4.5 on Windows Server 2012 R2 using PowerShell DSC via the WindowsFeature resource and the NET-Framework-45-Core feature. My question is, how do I use PowerShell DSC to ...
0
votes
1answer
78 views

Retrieve SCCM collection membership via PowerShell

I'd like to find a PowerShell script that retrieve the SCCM collections for a given computer or user. I know this can be achieve via a SCCM query, but I'd like to do this using a PowerShell function. ...
1
vote
1answer
184 views

Windows Activation Powershell Script

I'm looking for a method to automate activation Windows 7 machines through PowerShell. We get approximately 50 computers a month and it's slowly increasing, so manual activation is no longer possible ...
2
votes
3answers
35k views

How I can upgrade PowerShell on Windows Server 2008 R2?

I am using Windows PowerShell 1.0 in Windows Server 2008 R2. I have tried PowerShell 3.0 in Windows 8 and it looks good to me. Now the question is: How I can upgrade PowerShell on the Windows Server ...
0
votes
2answers
4k 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
47 views

Change keyboard repeat rate through powershell

I have an issue with my laptop wherein the repeat rate for the keyboard gets really slow after waking up from hibernation. I can fix this by adjusting the rate down in the control panel, applying the ...
0
votes
2answers
54 views

Setting an “unidentified” network as “Home” automatically

I have a (wired) network consisting of two Windows 7 (x86) PCs, a HP network printer, and a gigabit network switch. There's no router or DCHP, so they all have fixed IPs in the 192.168.0.xxx region. ...
3
votes
2answers
201 views

Windows Power Plan automation

I like to keep my Asus ROG G750JZ(laptop) on all the time and I have already automated sleeping at 01:00 in the morning, auto wake-up on opening the lid. However since I am not using the laptop all ...
-2
votes
1answer
64 views

Batch/Powershell - Empty directory - mkdir with todays date - backup folders

I'm trying to make a batch or a powershell script that: First: Empties the folder C:\backup\ Second: Creates a new folder with todays date withinin c:\backup\ Third: Copies 2 folders c:\123 and ...
1
vote
1answer
168 views

How to install a network printer on powershell?

I've been trying to install a network printer using Powershell on Windows 7 so that I can automate the setup of our development machines using Puppet. I found a couple of instructions around but none ...
0
votes
0answers
39 views

Add “PowerShell Here” and “Command Window Here” to right click menu for drives, folders, and current directories

I've tried applying and editing the .reg files, for example, here and here But can't seem to get a "PowerShell Here" and "Command Window" here option in all right click menus without holding Shift ...
0
votes
1answer
37 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 ...
3
votes
2answers
382 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 ...
2
votes
1answer
53 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
56 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
373 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
23 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
293 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
136 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
2k 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
48 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
29 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 ...
13
votes
3answers
35k 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?
15
votes
7answers
32k 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
132 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 ...
0
votes
1answer
62 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
38 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
1answer
61 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 ...
0
votes
1answer
124 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 ...
1
vote
1answer
91 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
72 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
119 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 ...
0
votes
0answers
327 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
113 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
0answers
58 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
27 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
58 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
80 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 ...