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

Shutdown/deallocate VM doesn't work in scheduled task

I created a scheduled task to shuwdown/deallocate itself (it's a VM on Azure) with Powershell. The PowerShell script is: Stop-AzureVM -Name "myvm" -ServiceName "myservice" -Force If the PowerShell ...
4
votes
2answers
14k views

Where is the known_hosts file for OpenSSH for Windows?

One of the servers I frequently log into via SSH has changed it's IP address. So, now I'm getting man in the middle attack warnings when I try to use SSH via Windows Powershell and OpenSSH for ...
0
votes
1answer
74 views

Is there a Window's Command Line Option to Show the Sizes of Directories

When I do a dir command it, gives this information: 02/11/2015 01:39 PM <DIR> bar 11/11/2014 07:22 AM <DIR> buz 02/12/2015 01:35 PM 140,660,736 foo.sdf ...
1
vote
0answers
39 views

Issues Adding Data to an XML Document w/PowerShell

Trying to add an element to an existing XML file using PowerShell. I have looked at several examples and my 'add' script works but, it is misplacing the element. Sample of XML I am using: ...
2
votes
1answer
8k views

How can I copy a file on a network share using a different login with powershell or batch file?

I have a file in a shared location that I want to copy over to my local hard drive. However I will not be running as a user that has access to the share. So I want to be able to authenticate under a ...
0
votes
1answer
118 views

In ConEmu / Cmder, how do you setup ConEmu Here to work with powershell?

I am trying to get the ConeEmu Here context menu item to work everywhere in windows explorer. Settings -> Integration -> ConEmu Here -> Command Currently I have: ...
0
votes
0answers
44 views

Reflect HKLM/SOFTWARE/Policies registry changes to HKCU/Software/MS/Win/CV/GPOs

Ok so I have a Local Group Policy (under Computer Config, not User Config) to force install extensions in Chrome. This policy needs to run for every user of the computer. The value is going to change ...
31
votes
5answers
43k views

Copy and paste in Windows PowerShell

How do I effectively copy and paste input and output in the Windows PowerShell?
0
votes
0answers
33 views

Why does PowerShell give “Access Denied” for Get-Content on a directory?

By accident, I recently tried running Get-Content on a directory. I'd initially thought it was a file because it was named very similarly to a common file I'd expected to be in the location. So I was ...
0
votes
0answers
29 views

Windows PowerShell - SqlServerCmdletSnapin100 Error

I am trying to run the following command through my winodws powershell: Add-PSSnapin SqlServerCmdletSnapin100 But I get the following error: How can I install SqlServerCmdletSnapin100? I can't ...
0
votes
1answer
37 views

How to filter this output from powershell?

This is my powershell command: powershell -noprofile -NonInteractive -Command "(gwmi win32_process | select ProcessID,ParentProcessID,@{e={$_.GetOwner().User}}, CommandLine) | ft -AutoSize" When I ...
4
votes
3answers
109 views

Windows Powershell doesn't seem to accept target paths with spaces

I was following this thread Is there a Win7 shortcut to position mouse in center of primary screen? Following the suggestion of the guy with 12 upvotes, I created a shortcut with the target file ...
0
votes
1answer
84 views

How can I get full command and parent process id from powershell?

It is the command I run in powershell gwmi win32_process |select ProcessID,ParentProcessID,CommandLine,@{e={$_.GetOwner().User}} And here is partial listing of the ouput ...
0
votes
1answer
89 views

GnuWin32 / sed unexpected behavior in Powershell

I am using GnuWin32 tools on Windows Command Line/Powershell. What is see: 11:15 enlil D:\Users\x> Get-ChildItem .gitconfig | sed "s/ */ /g" D i r e c t o r y : D : \ U s e r s \ x M o d ...
1
vote
1answer
888 views

Get song duration from an mp3 file in a script?

I am trying to list some of my mp3 files with Powershell. I have tried ls C:\test | Format-List -Property Name,Length which gives me Name : testfile.mp3 Length : 10058533 The length is the ...
1
vote
1answer
60 views

where does oneget install packages to?

I just installed the newest windows 10 ctp and wanted to try oneget to install everything I need. When using for example find-package vlc | install-package -verbose -force it gives me the following ...
0
votes
0answers
859 views

Powershell script to add user to active directory and set static IP

I have seen other similar questions but I am looking to fully automate the process and all of the examples I have found up until now are missing pieces that I need. Also, this is the first poweshell ...
10
votes
7answers
12k views

Powershell font too small on Windows 8.1 - how to adjust?

Question: On my Windows 8.1 machine, I need powershell to configure office web apps. When I start powershell, for a blink of a second, it shows as it should, but then it gets resized, and the font ...
1
vote
1answer
73 views

Reuse of environment variables in Path

Is it possible to reuse environment variables in the Path environment variable from PowerShell? There are some environment variables like %SystemRoot% defined and are used in Path variable ...
0
votes
1answer
95 views

How to get user last logon date on a specific server?

Need to export a table with user names (samAcountNames) along with their last logon date\time on to specific server on network (who is a member of a domain). According to google search, i can do it ...
1
vote
1answer
39 views

Set the text size (font size) in the ConEmu PowerShell window?

I have opened PowerShell in ConEmu. The text size is too small for a presentation. How do we increase it? I have tried the following ConEmu Settings: Size & Pos, Appearance, Text Cursor. I haven't ...
0
votes
0answers
36 views

Computer does not stay awake after scheduled task

I have a scheduled task that wakes up the computer to run a batch file. However the computer turns back off after some time. I have my computer set to (never sleep) so after waking up from the task it ...
-1
votes
1answer
25 views

Strange entry in the Services list

(Please forgive me if I've posted this in the wrong exchange). We had an issue with one of our servers this morning, due to a generator test. On examining the services more closely we found that one ...
0
votes
2answers
55 views

How to execute a .ps1 from another .ps1 file?

I have two PowerShell files. a.ps1 and b.ps1. At a center point in a.ps1 I want to start executing code in b.ps1 and terminate a.ps1 script. How to do it considering that both files are located in ...
0
votes
0answers
92 views

Windows task scheduler with regular user

I have a powershell script on my network share (\server\dir\my.ps1). if I run this from command prompt (powershell -file "\server\dir\my.ps1") than work as expected. if I create a basic task in the ...
2
votes
2answers
45 views

How to determine if two directory pathnames resolve to the same target

I am trying to implement a function in powershell that can reliably tell me if the directories referenced by two valid path names are indeed the same. It needs to be able to handle directories which ...
2
votes
1answer
146 views

Powershell - Elevation Loses Current Directory

One problem leads to another! User help just fixed one issue, which led to another as I continued working on this script. My script runs a check to see if the current user is an Administrator as ...
0
votes
1answer
48 views

How to remove multiple lines in a file using Powershell?

How to remove multiple lines in a file using Powershell? I am trying to delete some chunk of lines (line 16 to line 1463) from a file (notepad)
0
votes
0answers
15 views

intermittent reparsepoint attribute

We have a file server with a directory S:\ that is shared out as \\server\share. On the server we have the directories S:\rootDir1, S:\rootDir1\subDir, S:\rootDir2, and a junction ...
1
vote
0answers
25 views

How to disable and re-enable an (wireless) network device? [duplicate]

I know I can enable and disable my network Devices in Control Panel > Network and Internet > Network Connections. I use the context menu and click on "Disable" and then "Enable". Because I have to ...
0
votes
1answer
43 views

How can I stop a PowerShell script from running?

I have (so far unsuccessfully) tried to install SharePoint on my Windows 7/8.1 laptop. It fails when installing a particular prerequisite (Windows Identification something-or-other). But that's not ...
1
vote
1answer
65 views

CredSSP - How does it work?

Been trying to find a web site that lists the steps carried out to perform authentication - but to date have not found one. The reason being is that it is broken. Get 500 server error and have not ...
1
vote
1answer
37 views

PowerShell have Tab only fill in partial matches instead of first selection

I'm having trouble adapating to the behaviour of PowerShell tab completion from bash tab completion and wondering if there is a way to change it. In PowerShell when I press tab it expands to the ...
0
votes
0answers
31 views

why remote powershell session dose not need password

why remote PowerShell session dose not need username and password? this is very terrible because I feel anybody can connect remotely to my server. I use negotiate authentication method and server ...
1
vote
1answer
47 views

Automatically export history at end of powershell session

I can export my Powershell history using the scripts outlined in the Technet page on the subject, Get-History | Export-Clixml ~\PowerShell\history.xml and I can automatically load up the saved ...
0
votes
0answers
73 views

How do I use Powershell to set Delegate permission on a mailbox?

When I add a user to Outlook delegation, using this method I see them in the following powershell command [PS] C:\Windows\system32>Get-CalendarProcessing aaaa| fl AutomateProcessing ...
2
votes
2answers
640 views

Powershell has started running as administrator

Something unusually has happened recently on my machine: every time I start powershell, it starts with Admin privileges by default. It used to be that it would start just as my user unless I ...
2
votes
1answer
472 views

How to enable CredSSP

I am trying to use the -Authentication CredSSP switch when entering with PowerShell (2.0) in order to remotely launch a Script that can write to files or set up new PSDrives. I get an error when I ...
3
votes
2answers
4k views

Keep outlook 2010 open [duplicate]

Possible Duplicate: How to make Outlook 2010 minimize when I try to close it? I want to "disable" the ability to close Outlook2010. I always "close" it instead of minimizing it. What are ...
7
votes
5answers
8k views
0
votes
1answer
34 views

Is there a way to distinguish between 2 optical drives when opening and closing with PowerShell?

Is there a way to distinguish between my 2 disk drives when executing- $cd = Add-Type -memberDefinition @" [DllImport("winmm.dll", CharSet = CharSet.Ansi)] public static extern int ...
0
votes
1answer
88 views

Batch file needed to query a specific location

I am not a coder and would appreciate any assistance. I need a batch file which will query a NAS location and produce an output of the upper level directories (and maybe the second level down). The ...
0
votes
1answer
302 views

How do I detect and skip locked files in a PowerShell script?

So I have myself a PowerShell script that after much headaches I got working. Ii deletes files I no longer want and everything is great. Only one issue, it will delete a file whether it is open by ...
1
vote
0answers
52 views

How to install a network printer on powershell?

I've been trying to install a network printer using Powershell on Windows 7 so that I can automate the setup of our development machines using Puppet. I found a couple of instructions around but none ...
13
votes
3answers
5k views

Is PowerShell a complete replacement for console/cmd?

Right now I'm using the Windows console (cmd.exe) for some easy tasks (as checking my ip configuration or running some applications). But now I heard that there is PowerShell which actually is way ...
1
vote
1answer
15 views

Solution for media presentation - windows 7 [closed]

I'm looking for a solution to use a Windows 7 computer to act as a media presenter, with as little third party software as possible. Idea is to create a PS script or something that scans a ...
0
votes
1answer
73 views

How to copy and rename a file from one folder to another using Powershell?

I want to copy and rename a copied file. The file extension is ".ini". I have multiple folders (Banks) with years 1985-2007. Each of these folders (1985-2007) contains cfgfiles folder that contains an ...
1
vote
1answer
39 views

Possible to automate setting of Internet Explorer settings?

Is it possible to automate the setting of some Internet Explorer settings through some sort of self-contained script or program (and not something like Group Policy or domain controlling)? In ...
5
votes
4answers
4k views

How can I delete a folder with “illegal” characters?

I plugged my USB flash memory stick into a Mac and it gained some unwanted hidden folders. (See the question Prevent MacOS from making .* and ._* files for prevention.) I'd now like to remove these ...
1
vote
1answer
74 views

Extract site names from properties application pool

there are 2 sites that working in one pool. Me need to extract the names of the sites for future use. I use next command for exp. PS C:\> Get-Item IIS:\AppPools\tech-2 Name ...