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

Want to send automatic mails from email server, That To addres has to read from email that i received.?

I want to send multiple mail automatically. I will receive mail as FROM: abc@domain1.com TO: 123@domain2.com BODY: mail contains (username@domain3.com) What I want to is take the username@...
2
votes
2answers
507 views

Using Advanced Parameter Sets in a Function with Multiple Unique Switches

I am using Powershell 4.0. I am attempting to write a cmdlet and in this cmdlet I would like to use Advanced Parameter sets to have certain options available based on what parameter(s) is/are chosen. ...
1
vote
1answer
77 views

vagrant provision launches apps without ui on windows

I am trying to launch an application that needs ui on a windows box as part of "vagrant provision". I can see that the app is launched as the vagrant user in task manager but I see no ui on the screen....
0
votes
2answers
127 views

Automate script | Rename a defined list of filename by a defined list of word powershell

All my code: #read list filenames + filter# $listname = Get-ChildItem 'Y:\Users\H\Documents\D\Game Of Throne' -Filter *.bmp #Read list file txt# $line = Get-Content 'Y:\Users\H\...
-1
votes
1answer
147 views

Running Azure Active Directory Module via a batch file

I am creating a script in a batch file which is supposed to tell Azure to run instead of powershell. Does anybody know how to call upon Azure? I believe the way to call powershell is powershell.exe ...
0
votes
0answers
128 views

Plink in PowerShell ISE

How can I get plink to work in a PowerShell ISE window? It seems to work just fine in a regular PowerShell command window, but it just hangs when I try to use it in ISE, and doesn't prompt for a user ...
2
votes
0answers
190 views

How to rename files in file from lines of a text file

My script PowerShell: $liste = get-content "Y:\Users\H\Documents\D\Game Of Throne\prod\recup.txt" ` |Select-Object -last 1 $liste | ForEach-Object {Write-Host ($i++) $line} get-childItem "...
0
votes
1answer
728 views

Change the “modified date” of a folders (in possibly powershell)

From time to time, when I force-shutdown a Windows Server 2003 machine (I have no choice), the folders contained in a certain directory all change their 'modified date' to the current date. Luckily, ...
2
votes
2answers
1k views

Changing last modified date or time via PowerShell

Is it possible to change a file or folders last modified date/time via PowerShell? I have a folder folder1/ and I want to change the last modified date and time of that folder and it's contents via ...
2
votes
1answer
2k views

Powershell. How to invoke javascript on a web page using AutoBrowse module

I am trying to create some automatization using AutoBrowse module. I now want to click on a web page button which does not have id,name,href etc, just a javascript on click. I tried a number of ...
2
votes
1answer
278 views

Powershell DNS - how do i search a list of DNS Servers and then filter the results?

I am trying to search a list of specific DNS servers (i have in a file) and then query for a specific host name. I can do this bit :) The next bit is I wish to return a list of those DNS Servers ...
0
votes
0answers
73 views

Can I set the Password Policy on a GPO using Powershell?

I'm trying to automate configuration of a domain controller. I can create and link a GPO using Group Policy cmdlets in Powershell, but how can I set certain policies like the Password Policy for a ...
2
votes
1answer
319 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 ...
0
votes
1answer
111 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 http://proxy-...
0
votes
1answer
372 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
1answer
320 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
89 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
2answers
308 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. ...
5
votes
2answers
3k 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 ...
1
vote
2answers
274 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 ...
0
votes
2answers
123 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. ...
-2
votes
1answer
237 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 c:\...
0
votes
1answer
117 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
0answers
193 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 ...
2
votes
1answer
559 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?
2
votes
1answer
225 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
134 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
1answer
67 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 ...
0
votes
2answers
187 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 ...
1
vote
1answer
60 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 ...
1
vote
1answer
111 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 ...
0
votes
1answer
106 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
93 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
93 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
792 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 ...
1
vote
1answer
3k 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 ...
0
votes
0answers
2k 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 ...
1
vote
2answers
542 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
1answer
1k 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
1answer
495 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. ...
0
votes
0answers
113 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> Set-...
1
vote
1answer
176 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
314 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
3answers
151 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
1answer
600 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
2k 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
26 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
1answer
57 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
35 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, Kazakhstan\12....
0
votes
4answers
380 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, ...