Microsoft’s command-line scripting language. V 2.0, which was introduced in Windows 7 and Server 2008, features remoting.

learn more… | top users | synonyms

0
votes
0answers
8 views

Copy from SFTP to local host using Username/ privatekey.ppk using powershell

would you please help me , i need script that copy files from FTP server to local host using only Username and .ppk as a private key , i don't have password. is it possible to do that. Please ...
0
votes
0answers
39 views

ProgressBar Overlay Or ProgressBar from Copy Functions

I'm new to powershell, and I'm working on a script to copy the entire Drive D:\ from remote machine to local drive as a backup. I'm using the copy function, it is the only thing I found to copy the ...
0
votes
1answer
300 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
147 views

How to unblock file via WindowsPowerShell?

I am using windows Vista buissnes 32 bit. When I try to execute command : dir *.* -Recurse | Unblock-File I am getting : The term 'Unblock-File' is not recognized as the name of cmdlet, fun.. I am ...
1
vote
1answer
232 views

Powershell 2.0 Enter-PSSession cannot get New-PSDrive working

I have a remote computer which I can Enter-PSSession successfully. When I execute: New-PSDrive -Name "G" -PSProvider Filesystem -Root '\\fileserver\apps\etc' I get the following error: ...
1
vote
1answer
173 views

How can I use PowerShell to parse filenames and rename them?

I've got a project analyzing logfiles. Someone, in their infinite wisdom, is naming the logfiles MM-DD-YYYY-HH-MM.LOG (e.g., 10-31-2012-18-00.LOG for 6:00pm on October 31, 2012). My first order of ...
1
vote
0answers
100 views

Change State of Windows Update- Local Group Policy Editor without UI?

In windows server 2012,for this manual step how can i do from script, start>run>gpedit.msc>administrative Components>Windows>Windows update In that 1) Do not Display " Install ...
1
vote
2answers
4k views

Powershell script to list scheduled tasks on remote systems

I want to write a PowerShell script that lists all Scheduled Tasks on remote systems, and includes the user account which will be used to run each task. The local system is running Windows 7, with ...
0
votes
1answer
365 views

Windows Batch File (WMI) - taskkill process based on memory usage

Is there a way using WMIC, bat files, or powershell, to kill a task with a particular task name if the amount of virtual memory the process is using is above a certain limit? Specifically I want to ...
0
votes
1answer
218 views

Can't run start-process command

I'm trying to run a command found in this answer. The command is start /w %SystemRoot%\system32\pkgmgr.exe /ip /m:Windows6.1-KB2506143-x86.cab Trouble is, it doesn't work for me. Indeed, it ...
0
votes
0answers
47 views

Setting up WINRM for remote powershell scripts over https

I have set up powershell and winrm to run remotely over http but we have a new server provider and they want this set up over http. Do I have to create an IIS site and set, complete with certificates ...
0
votes
1answer
227 views

PowerShell “.count” method causing incorrect processing

I am creating an array in PowerShell that doesn’t always contain data (sometimes it is empty). I need to verify that the array contains data before trying to do anything to the array objects. When I ...
0
votes
1answer
133 views

Powershell function with Parameters throwing null exception

This script is throwing a null exception and I am not certain why that is the case... Function StopServices{ Param ( $ServiceName, $Remoteserver ) ...
0
votes
0answers
43 views

PowerShell reports missing method, when method exists

I've had a problem recently with PowerShell reporting that a method does not exist on an object, while Get-Member reports that it does. This doesn't happen with all methods, but I have had it happen ...
0
votes
3answers
4k views

How to run “winrm quickconfig” on all LAN computers remotely

I want to start doing my remote LAN work using powershell, but it seems I need to run winrm quickconfig on all LAN computers before I can remotely connect to them. How can I run that command on all ...
4
votes
0answers
612 views

How can I easily split a CSV into two Excel worksheets with PowerShell? [on hold]

I recently found out that PowerShell can be used to write Excel documents. The first use I thought of for this was to (at least partially) automate parsing of some CSV reports that I regularly have to ...
1
vote
2answers
44 views

Access the user's selection from a previous cmdlet

I'm writing a script that I want to be able to react depending on the user's answer to a confirmation prompt that is part of a cmdlet being run in the script. For example: Stop-Process -Name notepad ...
0
votes
1answer
304 views

Cannot install Windows Powershell on Vista64

I am desperately trying to install Powershell 2.0 on my Windows Vista 64 system. I downloaded KB968930 like a hundred times but when I start it it always says that I cannot use it with my system. ...
0
votes
2answers
155 views

How to remap shortcut in Powershell

I want to remap the shortcut in powershell, for example, I'd like to use Ctrl + a to make cursor at beginning of line, Ctrl + e to make cursor at the end of line, etc. I searched the method in Google ...
1
vote
1answer
1k views

PowerShell touch all files newer than

I have found the following question on ServerFault: Windows recursive touch command Which partially answers my question with this answer: Windows recursive touch command However, I would like to ...
0
votes
0answers
69 views

Powershell 'help' returns nothing

I am unable to get output when I run help... in Powershell version 2.0. Server 2K8R2 SP1. Get-Help... works as expected.
2
votes
1answer
1k views

Powershell Select-String to remove a string line from a variable if matched

I am trying to do the following: Look for a file in a folder which has been modified in the past 24 hours Find a specific section of the file Remove lines from the section matching specific ...
0
votes
1answer
892 views

Setting recycle properties on IIS7 App Pools using powershell 2.0

I am trying to set the current properties using powershell disallowRotationOnConfigChange disallowOverlappingRotation I do this with the following code $appPools = Get-childItem IIS:\AppPools ...
0
votes
1answer
392 views

Powershell, Task Scheduler or loop and sleep

I have a job that needs to go off every minute or so, it loads a DLL i have written in C# that retrieves state for an SQL Server Mirror (Primary, Mirror and witness) for a number of databases; it ...
2
votes
1answer
2k views

Copying the timestamp from one file to another (using PowerShell 2.0 on Windows-7)

On my Android phone, it was configured to save pictures to the Phone-memory. I wanted to free up some memory in the phone, and since I have a 16GB uSD card, I: 1) copied all the pictures to my ...
11
votes
3answers
9k views

Show human-readable file sizes in the default PowerShell ls command

How can I modify the default ls (Get-ChildItem) in PowerShell so that it displays human-readable file sizes, like ls -h on a *nix machine? ls -lh does simple logic with the file size, so that it ...
1
vote
1answer
241 views

How to set and print environment variable in Power Shell?

I work on Windows 7 and I wont to know how to set and print environment variable in Power Shell (for example $PATH)?
2
votes
1answer
2k views

How can I sort objects by third column in Powershell?

I've a text file like this: 4108689096 2531 ./ssss/132432.odt 481446057 2293 ./abc/a.txt 3157353085 1096 ./dsjvbjf/c.docx 653380669 1824 ./bcd/x.avi And I'd like to achieve in Powershell to sort ...
0
votes
2answers
706 views

can I get powershell to properly copy multiline text like Bash in Ubuntu does?

I use an Ubuntu VM at home for Rails development and I've gotten a bit spoiled by Bash. When I copy multiline text from Bash, it seems like it's pretty good about knowing that text is single line or ...
3
votes
1answer
1k views

How to start a Windows XP Virtual PC application using Powershell from Windows 7?

This is a shortcut target of an application I launch from Windows 7 that starts a program in Windows XP Mode. %SystemRoot%\system32\rundll32.exe ...
108
votes
7answers
86k views

Native alternative to wget in Windows PowerShell?

I know I can download and install the aformentioned library (wget for Windows), but my question is this: In Windows PowerShell, is there a native alternative to wget? I need wget simply to retrieve ...
1
vote
2answers
941 views

Default Encoding in Windows PowerShell 2?

What is the default encoding (charset) used by PowerShell? I have figured out it is not UTF-8, but how can I know what encoding is used then instead? Thanks!
4
votes
1answer
7k views

Running msiexec with PowerShell

I'm try to run msiexec in PowerShell but I keep getting an error message. If I run it from cmd then it's all fine. Can someone please let me know how I can run this command in PowerShell? This is ...
5
votes
2answers
7k views

Powershell: Get inital character string from file name and create directory from string, then move files

I have a folder with the following file names: 00150005D201110172338427995.vpf 00150005D201110180005318058.vpf 00150013D201110180014448082.vpf 00150013D201110180022268098.vpf ...
5
votes
2answers
457 views

Any quick way to call a directory using an environment variable in Powershell

Say I have a user environment variable named p and it's value is the path where I store my projects. In Command Prompt you can use them to quickly access a particular directory from anywhere on the ...
1
vote
2answers
347 views

How to start/stop service on a remote computer with an out of sync clock

I'm working in a MS Windows Domain. I'm trying to centrally (remotely) start and stop the W32Time service for a certain amount of time (to disable Time Server update e.g for two hours) then remotely ...
0
votes
1answer
411 views

Get-Clusternode error

I've just started in the world of Powershell and I'm writing a simple script to put hosts in maintenance mode, apply patches, reboot, then put back into server. I decided to use the failover ...
0
votes
2answers
2k views

List ACL with ACE in the proof in POWERSHELL?

I can list acl from an OU with Get-ACl cmdlet but I need to see the permission entries like we can see in : OU properties -> Security Tab -> Advanced -> View with Active Directory Users and Computers ...
2
votes
1answer
2k views

problem powershell cant access to a network share

I use PowerShell to check if any ports are open on my computers. I have eight Windows Server 2008 R2 machines and run the following script: $localhost = get-content env:computername foreach($port in ...
7
votes
3answers
8k views

Where can I download Powershell 2.0 for Windows 7?

I have spent the better part of a day hunting the Internet looking forr a way to download Powershell 2.0 to my already Win7 environment. Windows 7 is supposed to come with PS 2.0 however - I have 1.0. ...
6
votes
4answers
11k views

Is Windows PowerShell 2.0 installed by default on Windows 7?

http://msdn.microsoft.com/en-us/library/ff637750.aspx claims Windows PowerShell 2.0 needs to be installed on Windows Server 2008 and Windows Vista only. It is already installed on Windows Server ...
2
votes
1answer
9k views

NetBios lookup from command line/powershell in Vista

Am trying to resolve an IP address to its Netbios name via the command line or via powershell. the system I am using is Vista SP2 so I do not believe NBLookup.exe will work. are there any ...
0
votes
1answer
130 views

Powershell and group policy

Please help! I have created a "vbs" to call a powershell command to move computer account to a certain "OU". This failed because it can't call AD powershell module. So if i run the powershell in the ...
3
votes
2answers
4k views

Using powershell call native command-line app and capture STDERR

I'm using a port of a cygwin tool on Windows which writes normal status messages to STRERR. This produces ugly output when run from PowerShell: PS> dos2unix.exe -n StartApp.sh StartApp_fixed.sh ...
5
votes
1answer
5k views

WinRM - what it is and how to use it?

During installing updates I noticed 'PowerShell 2.0 and WinRM' update. Upon reading some Microsoft & Wikipedia pages I read that it is remote management system that runs on SOAP and that it is ...
1
vote
2answers
528 views

Windows PowerShell ISE doesn't import PSCX 2.0 module

i am using Powershell 2.0 with the PSCX 2.0 module. When writing PS scripts inside Windows PowerShell ISE no Cmdlets from the PSCX module are availible. For example running "Get-DriveInfo" from ...
9
votes
2answers
1k views

Is there a way to run git within Powershell?

Is there a way to run git within Powershell? I have a Windows 7 box with msysgit. I'd like to have a single shell to also run all my git commands as well as play around with Powershell scripting.
3
votes
2answers
2k views

Where is Powershell 2.0?

I just uninstalled Powershell 1.0 and installed Powershell 2.0. Where are the Start Menu shortcuts?