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
1answer
6 views

Hard Code a system value?

I work for a Tech company, and when we sell computers we also include a sticker with an inventory number, for easy reference in our database. My question is as follows: Is there a way (I am sure ...
2
votes
1answer
28 views

How to rename an executable from its details

I have loads of .exe files that got renamed to file1.exe, file2.exe, etc. When you look at a file's Details under Properties (in Windows Explorer), it has the original file name under "Product Name". ...
0
votes
1answer
8 views

PowerShell unable to Set-Execution policy

I am trying to set the script execution policy in PowerShell. But when I tried, I get: PS C:\Users*> Get-ExecutionPolicy Restricted PS C:\Users*> Set-ExecutionPolicy RemoteSigned ...
5
votes
2answers
697 views

Recursive folder rename through command line

I have 500000 plus files in over 3000 directories and need to rename all folders called PHOTOS to Photos. I also need to Rename any Folders call Photos blah blah blah to be called just Photos. It ...
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
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 ...
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
1answer
2k views

Running 'Start-Process' Remotely: How to Display Standard Output?

I have a PowerShell script for installing software on remote computers. To date I have been successfully using the following code: $prog = "ping" $arg = "localhost" $computername = "MACHINE01" ...
0
votes
1answer
5k views

Call PowerShell script from Excel macro

I'm trying to call a PowerShell script from a macro in Excel. I have seen a number of examples along the lines of: retval = Shell("powershell ""C:\MyTest.ps1""", 1) When I try to use this, ...
1
vote
2answers
6k 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. ...
0
votes
0answers
27 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 ...
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 ...
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 ...
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 ...
1
vote
2answers
28 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 ...
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
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 ...
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
2answers
3k views

Download entire directory from a website using Powershell

I have been using the following command to pull back files from a web server and store them on my local machine: $client = New-Object System.Net.WebClient ...
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 ...
3
votes
3answers
73 views

Temporary Password for Domain Admin

A small non-profit company handling confidential information must grant remote domain admin access to their external IT services provider who manages the entire network, including new PCs, etc... ...
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 ...
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 ...
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 ...
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 ...
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
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 ...
0
votes
1answer
3k 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 " ", "_" ...
-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 ...
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
1answer
1k 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
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
58 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, ...
1
vote
4answers
5k views

Converting Visio (.vsd) files to PDF automatically

I am trying to create a scheduled task to convert all my .vsd files to PDF format so all of our devices can read them (Linux, Mac, smartphones, etc.), and I would prefer not paying for something that ...
0
votes
1answer
137 views

Creating Virtual Disk in PowerShell / Help Understanding Error

I am trying to setup a new Virtual Disk in Hyper-V Server 2012 r2. Since there is no GUI, I would like to do this using PowerShell. So far I think I have successfully created a new pool from two ...
2
votes
1answer
53 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
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
43 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 ...
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 ...
2
votes
2answers
8k views

How to open Internet Explorer for the desktop from command line in Windows 8?

There are two different Internet Explorer versions in Windows 8. I would like to open Internet Explorer for the desktop from command line. We can run it via Win+R → iexplore, but I would like to run ...
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 ...
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 ...
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
1k 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
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
24 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
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 ...