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
2answers
40 views

How to check version of IE on Windows 7 with PowerShell?

I want to check which version of IE I have on my Windows 7 machine. I would like to do this with the command line, either through Command Prompt or PowerShell. Thank you!
0
votes
0answers
26 views

Windows 8.1 Pro x64 None of the Modern UI apps work, Powershell, CMD, and wsreset returns error

So, today somehow my pc got messed up while I wasn't home, don't ask how because i don't know (maybe a windows update gone wrong, or ghosts were messing with it :) ) First it started with black scrn ...
0
votes
1answer
51 views

Most favorite scripting language used by IT pros [closed]

What is the most favorite scripting languages used by IT pros and why? I see that Javascript is mostly used by developers while legacy VBScript and Powershell for Windows admins and bash/shell for ...
2
votes
2answers
23 views

Trying to pass variables to Send-MailMessage arguments and failing miserably

So I have a problem. I’m trying to write a scripts that pings a list of hostnames in an external .txt file, and send an email alert if one of them goes down. I’m having a few problems with it, but ...
1
vote
0answers
18 views

wbadmin systemstate parameter

I run a powershell-based backup script using wbadmin on different systems (i.e. Windows 7 Professional / Windows 2008 R2 / Windows 8.1 / Windows 2012R2). In this script, i utilize the -systemstate ...
5
votes
1answer
35 views

Error trying to save Word document as PDF in PowerShell script

I have the following PowerShell script to convert a folder of docx files to pdf: param ( [string]$folder = '.' ) Add-type -AssemblyName Microsoft.Office.Interop.Word $word_app = New-Object ...
2
votes
1answer
18 views

PowerShell get TotalPhysicalMemory (RAM) without decimals

I'm writing a powershell script to inventory some info about computers (CPU, RAM, HDD, etc...). Everything is working quite well, but I'm stuck at getting the right output for the amount of RAM. Here ...
1
vote
2answers
27 views

Path too long when deleting from powershell on remote computer

What is the easiest way to delete the file on remote computer with powershell if name longer than 260 chars? I have the following code but I am hitting 260 chars limit. $s = New-PSSession ...
0
votes
1answer
25 views

PowerShell ISE open previous files

How can I configure PowerShell ISE so that it will open tabs for each file that was previously opened when I closed it? This is particularly helpful since I typically come back to work on the same ...
1
vote
0answers
17 views

Set printer preferences

I am writing a script setting up printers and drivers. One of the driver I install, contains a bug for old printers used with platforms further than Windows Vista. I need to update the preferences of ...
1
vote
1answer
60 views

Recursively delete files that match file name (PowerShell script)

I've been converting my old batch files to powershell scripts with decent success. However... I can't quite figure out what would be the best and efficient way to do it in this case. Here's the batch ...
0
votes
0answers
31 views

call environment path commands from powershell

I can call any executable included in the environmental variable path from a command prompt by simply calling its name. However when i try to do the same from Power-shell I get an exception the ...
1
vote
0answers
24 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 ...
2
votes
1answer
35 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
17 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 ...
0
votes
2answers
37 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 ...
-1
votes
1answer
17 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
22 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
41 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
57 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, ...
0
votes
2answers
29 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
42 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
52 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
29 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 ...
0
votes
0answers
31 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
37 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
44 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
54 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
23 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
55 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. ...
3
votes
1answer
103 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
57 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
48 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
53 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 ...
0
votes
1answer
34 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
33 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
30 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
0answers
57 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
48 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
20 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
51 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
28 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 ...
0
votes
0answers
90 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 ...
1
vote
1answer
42 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
32 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
60 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
32 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
30 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
70 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
196 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 ...