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

Subtract one day on all time stamps touched today in whole system- windows 7

In my windows-7 PC due to cmos battery failure I have to set date time.But i did wrongly i.e set 14th August instead of 13th August. And I found very late after a lot of work done. Now I want to ...
1
vote
1answer
261 views

Trim folders after a specific character in powershell

I'm trying to trim the sub-folders of my music directory . I want to remove everything behind the "(" in the folder names. example: d: \ media \ folder1 (2011) d: \ media \ folder2 (2012) what I ...
1
vote
1answer
66 views

Can a Windows scheduled task update itself and how would I do it?

Can a Windows scheduled task update itself and how would I do it? I'm using Windows Server 2008. I've seen some Powershell scripts that create tasks from xml; would this be the right approach?
1
vote
1answer
1k views

PowerShell script to re-install printer, set to default if it was default

We have a printer at work that is giving us problems. We have tried a few different solutions but when a user goes to print to this printer Windows 7 will sometimes display something like: Windows ...
1
vote
1answer
729 views

cmd to powershell transition in batch-script

Is there a way of writing a batch-script that's executed via C:\>cmd.exe a.bat to switch into powershell.exe and run the remaining lines of code? 1. | echo "Hi. I'm cmd.exe." 2. | powershell 3. | ...
1
vote
1answer
599 views

Changing remote server date via Powershell

I need to change the date of a server to the next day then run a sql script and then change the server date back. I figured out how to change the server date via powershell Invoke-Command ...
1
vote
1answer
732 views

Trouble saving an edited XML file in a PowerShell script

I am writing a PowerShell script that needs to edit the xml config file for the Claims to Windows Token Service (C2WTS) as "any user" but have been unable to save the file once I have made changes to ...
1
vote
1answer
4k 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 ...
1
vote
1answer
828 views

Basic Auth & Internet Explorer Automation in Powershell

I'm in the need of automating an administration task of a web application. I used Powershell and the InternetExplorer.Application ComObject to accomplish this task. The relevant part is to navigate to ...
0
votes
1answer
39 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 ...
0
votes
1answer
17 views

setting up variables and the results from a function within a string - all as a string in powershell

I am new to this and could use some assistance. I have the following function and trying to add the result from the function into the strings below. What am I missing to accomplish this? I just want ...
0
votes
1answer
16 views

Using powershell, how do I extract the thumbprint from an SSL Certificate without installing it?

Every example I've found on StackExchange, and other internet forums, etc all tell me how to get the thumbprint from a certificate already installed into a certificate store. Alternatively, the ...
0
votes
1answer
53 views

Restart a computer at a given time with PowerShell

I'm looking for a way to restart a computer with PowerShell (Restart-Computer), at a given time (Example: 03:00AM). The PS-Script itself will run at a random time, when the user executes it, so it's ...
0
votes
1answer
24 views

Checking WinSCP connection status in PowerShell script

I have a script that get files from one location to another. My script works fine. However I'd like to check first for "connected sessions". With SSH.NET PowerShell module I checked this with: ...
0
votes
1answer
49 views

Change the default Mouse Pointer Colour on boot in windows 8.1

How do I change the default (White to black) Mouse Pointer Colour on boot in windows 8.1
0
votes
1answer
68 views

Find highest possible screen resolution from command line

With Powershell, I can request the current screen resolution. this is not what I'm trying to do. I'm trying to find the maximum resolution I can set the screen to (slider all up). Is this even ...
0
votes
1answer
22 views

How to make tee not break lines at window width in powershell?

Currently I'm doing the following command to look through all files in a folder for a string, and then tee that line to a file: ls -r [folder] | sls "dummy text" | tee dummy.file These lines of ...
0
votes
1answer
28 views

How to bring vim back to foreground in Powershell

launch vim from powershell hit control+z (you are dropped back to powershell, vim is in background) ??? How do you bring Vim back to foreground? EDIT: I have tried fg
0
votes
1answer
44 views

Powershell is installed but winrm is not found

one of my servers is win 2003 and has powershell 2.0 installed, but I don't see winrm service there and can't thus run "Winrm quickconfig". It says "command not found". As a result, I can't call ...
0
votes
1answer
22 views

MS Surface / Windows PC - Wipe Between Users

As a company we have a few devices like MS Surfaces and some netbooks that are used for open access within social spaces. The problem being sometimes these devices are abused and wallpapers changed ...
0
votes
1answer
9 views

Inspect Exchange items

I would like to inspect mail and calendar items stored in an Exchange mailbox, by id, to see all their properties that are stored for them. Is there a way to do this (in powershell or the like)?
0
votes
1answer
54 views

Error on “-e” parameter when running makecert command in powershell

I am trying to run the following command in Powershell on a machine running Server 2012: makecert -r -pe -n CN="*.$domainVariable" -b 01/01/2000 -e 01/01/2036 -eku 1.3.6.1.5.5.7.3.1 -ss my -sr ...
0
votes
1answer
28 views

custom object powershell multiple items

I have this code wich work great for only one item if I add a new item it just delete the older one I've tried many way but I can't find how to do this can you help me? Import-Module ...
0
votes
1answer
50 views

What am I doing wrong in my powershell script

Ok here is the thing. I tried to make a PowerShell script to create some folders and to change a couple of strings in a .txt file. But as you can guess it is not working. See my configuration below: ...
0
votes
1answer
330 views

Download indivual PST from Office365 Exchange?

I am migrating my company’s email from Office365 to GoogleApps. While GoogleApps has an online migration service for email, it doesn’t for Calendar and Contacts. I know that I can go to each ...
0
votes
1answer
55 views

Why does this script prompt me for an InputObject?

I have a script that is supposed to list all the installed programs on a machine. I want it to export it to a file for me. I keep getting the error: Supply Values for the following parameters: ...
0
votes
1answer
177 views

Using PowerShell to Close Firewall Port

I'm doing some end to end testing of an application and I need to be able to close then open a port in Windows Firewall using PowerShell commands. I've found a script that adds a firewall rule to open ...
0
votes
1answer
81 views

How to install a mmc certificate on Windows?

I am not familiar with Windows very much, and I have trouble installing a MMC certificate. I am following this description to use MMC to create a certificate, but I cannot complete the step labeled ' ...
0
votes
1answer
51 views

Download Excel_data.xls compare with excel_local.xlsx and import

I am trying to write a PowerShell script that will download some Excel data from a webpage, then compare the data to my local file and import the data if there is a duplicate I would like it to add a ...
0
votes
1answer
148 views

how to batch change date created to date modified

I have many video files ending with extensions mov, avi, mp4, and mts. I need to change their "date created" to their "date modified value" I tried using the following powerhsell script: ...
0
votes
1answer
415 views

Create and configure a Windows taskbar toolbar via a script

When I right-click a Windows taskbar toolbar, I can toggle some options such as Show Text, Show Title and Lock the Taskbar. I can also reorder the icons on the toolbar and set it's position. How can ...
0
votes
1answer
344 views

Audit Windows Server/Desktop Product Key usage

The company I work for has a fairly big domain of Windows Desktops and Servers. We also have standalone servers that are remote to our site but we have direct access to. We need to audit our license ...
0
votes
1answer
677 views

How to Launch an App in an Existing Session

When a scheduled task runs I would like to open a Powershell window on my desktop to tail the log file and watch the progress. Specifically I would like the task to open the window on my desktop and ...
0
votes
1answer
362 views

Windows 2012 Domain Controller NETLOGON error

We have Sonicwall firewall user authentication System active since last two months. We have Windows 2012 Active directory server setup with around 1400 user account created. These accounts were ...
0
votes
1answer
2k views

Remove column header from sql query output in powershell

I want to remove column header from sql server query output. I did the search but not found any solution. I have a script. $Database = "temp" $Server = "localhost" $AttachmentPath = "output.csv" # ...
0
votes
1answer
184 views

Error while deploying unity web player application on Parse.com

I have created a game using unity game engine and build it using unity web player.After building i got two files client.html and client.unity3d . Now I am try to deploy these on Parse.com . Initially ...
0
votes
1answer
310 views

PowerShell Create new Active Directory user with password as secure string

Having some trouble creating a command to create a new user in powerShell, the code I'm using is: PS C:\Users\Nicky> New-ADUser -Name johnd -GivenName John -Surname Doe -DisplayName John Doe ...
0
votes
1answer
110 views

Run script from powershell in the same window

I have installed PHP and PHPUnit in my PC. Both of these files are in same directory and I have added to enviroment variable path. I have also associate .phar extension to run with php.exe ...
0
votes
1answer
990 views

Enable local administrator account for clients from server 2008

I ran into a problem with one of my client , its local administrator account is disable, also I can't log in this machine with its domain user (because of this problem), now I wanna change its ...
0
votes
1answer
2k 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, ...
0
votes
1answer
151 views

Unable to SSH to my virtual machine via Windows Power Shell ISE

Well, I have a Linux virtual machine running in my vmWare. And I would actually love to use my Linux in Windows Power Shell. So I usually use it by doing an SSH to my VM. Recently I came across the ...
0
votes
1answer
328 views

Robocopy: copy files preserving folder structure but adding a subfolder

I need to copy a folder which contains subfolders with files to a shared folder on another machine. During that, the script should create a custom subfolder in each destination folder and place files ...
0
votes
1answer
89 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 ...
0
votes
1answer
133 views

Look for many different strings in many different log files?

I have a list of files that have gone missing somewhere in our system at work. I also have a folder full of 41 log files adding up to 46 MB that hopefully have log entries pertaining to the missing ...
0
votes
1answer
98 views

How do I Refresh my shortcut file in Windows 8.1

OK so I was trying to change the color of the tiles in Win 8.1 and came across this link Customising Start Menu However I didn't understood the Step 7 and have no idea what do do that. I created the ...
0
votes
1answer
832 views

Running RSAT Tools as another user using Powershell

What I try to accomplish is running some RSAT Tools out of a Powershell-Script as another user (Domain-Admin). Here is my run code: Start-Process -FilePath "C:\Windows\system32\mmc.exe" ...
0
votes
1answer
1k views

Adding many IP addresses to Windows Firewall using CLI fails partially

I have a PowerShell script which adds IP addresses to Windows Firewall using the "netsh advfirewall" command. (As described in this question: How to append netsh firewall rules, not just replace). ...
0
votes
1answer
211 views

Is there a way to change the PowerShell banner message?

Every time you start PowerShell (unless using the -nologo parameter), a Microsoft copyright notice message appears. Windows PowerShell Copyright (C) 2012 Microsoft Corporation. All rights reserved. ...
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
1answer
323 views

How do I renaming files in a batch with a counter?

I have 14,000 picture sorted into files by year and month but taken with multiple cameras. I want the file name to reflect the date the photo was taken. For example, all pictures taken on October ...