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

3
votes
2answers
104 views

Why am I not getting my logon session from a WMI query?

I'm writing a program one of whose functions is to get the current logon sessions on a Windows computer. It queries WMI for the current sessions with logon type 2 (interactive), logon type 10 (remote ...
0
votes
1answer
48 views

run powershell script as local admin

i am creating a PS script that need to be run on more than 500 machine. Script will execute via task scheduler at specific interval. I am not sure what is the best way to execute this script with ...
-1
votes
1answer
45 views

Can't create windows 10 powershell shortcut with admin privilege

I want to create shortcut to powershell with admin privileges, but start as administrator option is disabled and i am using admin account on Windows 10. I can start admin powershell via context menu, ...
3
votes
1answer
27 views

How to remove command duplicates?

The new PowerShell has a default irritating feature of keeping duplicate commands in the keyboard buffer. For example, if I had executed the command DIR ten times, pushing the Up Arrow will show ten ...
1
vote
1answer
33 views

Windows 10: iTerm-like system-wide hotkey for showing PowerShell on any virtual desktop

This is my iterm preferences window. Here I set a system-wide hotkey where if I press that hotkey, no matter what virtual desktop (or rather the OS X equivalent of virtual desktop) I'm on, my current ...
0
votes
0answers
69 views

Can't Remove Folder with Powershell But Can with Command Prompt

I'm trying to delete a folder in an install script using PowerShell. The script copies a bunch of files to a distribution folder (using RoboCopy) and then cleans up superfluous files and folders. I ...
1
vote
1answer
24 views

How do I install Azure Powershell *on* an Azure Cloud Service?

I have need for a cloud based intranet application to run Azure Powershell. I've done a bunch of digging and I cannot find anywhere that gives me an understanding of the process I need to follow to ...
1
vote
0answers
14 views

Can I load Powershell AD Module as another user?

I have a script that I use to automate AD and Office 365 account provisioning. Everything is working just fine. The only "problem" is that I have a regular domain account and another account which is ...
0
votes
1answer
31 views

Powershell Has Stopped Working

When I run powershell I get the error: powershell has stopped working There doesn't seem to be any relevant errors in the EventLog. I get this when I run powershell as an admin or a normal user. ...
1
vote
1answer
64 views

How to use Powershell to filter out multi-lines group of text from a file?

I have an error log that I would like to filter out all the known errors using Powershell. I know how to filter by line in powershell, but my problem is that the errors in the error log span multiple ...
-1
votes
1answer
76 views

Add Powershell as Administrator to Explorer Context [duplicate]

Presently I have run Command Prompt as Admin in my context menu. I would like to have similar functionality for Powershell as Admin. Can any one guide me, how do I achieve that? Simply I tried to ...
1
vote
1answer
56 views

Have output of 'sudo' script printed to same Powershell window?

I found this 'sudo' script online: function Elevate-Process { $file, [string]$arguments = $args; if([System.IO.File]::Exists("$(get-location)\$file")) { $file = ...
1
vote
2answers
332 views

Unable to Connect to Office 365 via Powershell on Windows 10

I'm trying to connect to Office 365 via Powershell just like I always have and for whatever reason it is not working. I'm running Windows 10 Enterprise and one of the things I noticed is that ...
0
votes
0answers
16 views

Recovering fonts in win 8.1 using command prompt & powershell failed

In Windows 8 after restarting my fonts were messed up so I tried to recover my fonts using powershell but it gives me the error: object reference not set to an instance ... I was trying to remove ...
2
votes
1answer
105 views

Powershell script to clean up folders

There's a need to do a weekly cleanup of FTP user account mailboxes on our server and it has about 50 user accounts defined. Below is an example of the FTP user mailbox folder structure which each ...
0
votes
0answers
55 views

Could not retrieve 'System.Collections.Hashtable.AutomationCertificateName' certificate asset on azure

I import "Connect-Azure" workflow from Import runbooks from the Gallery which is below. workflow Connect-Azure { Param ( [Parameter(Mandatory=$true)] [String] $AzureConnectionName ...
0
votes
1answer
50 views

How do Powershell commands work?

Is it possible to find the files related to specific commands or config files? For example I want to know the full detail of what happens when I type a command such 'add-appxPackage'? I know what is ...
1
vote
1answer
92 views

How can I restore `cmd.exe` executable?

I locked myself out of my old windows 7 machine (forgot my admin password). However, I know about this sethc.exe trick to reset a forgotten password. So, I created a bootable linux distro, swapped ...
0
votes
1answer
59 views

Powershell With Two Network Connections

The computer I am using (Windows 7 Enterprise) has two network connections, one which provides access to the internet and university network - this adapter in the the one which should be used for most ...
0
votes
0answers
74 views

How to configure IIS' FTP server using Add-WebConfiguration

I'm configuring an IIS' FTP server using powershell, but I'm having problems using powershell to set access configuration. I'm using: Add-WebConfiguration '/system.ftpServer/security/authorization' ...
0
votes
0answers
21 views

A Parameter connot be found that matches parameter name 'SingleItemRecoveryEnabled'

I am currently trying to set up GFI mail archiving with office 365, and have been following these instructions; I have gotten to the point of disabling the recoverable items folder on the journaling ...
0
votes
0answers
54 views

Avoid Mount-DiskImage assigning drive letter to networkshare

I have a driveletter for a network share that I'd like to keep, but how do I avoid Mount-DiskImage from assigning the same drive letter? $mountResult = Mount-DiskImage -ImagePath "C:\path\to\dvd.iso" ...
1
vote
0answers
70 views

Running a specific PowerShell command in CMD

Im able to run simple PowerShell commands in cmd such as "LS" for instance this way: PowerShell -Command ls But what I really want to run is: [System.IO.Directory]::GetFiles("\\.\\pipe\\") If I ...
0
votes
2answers
161 views

Powershell A Drive C Does Not Exist

I am using a regular system, nothing virtual, my C drive is not mapped which I see in some forums. Environment path not set? I started a tutorial to learn Powershell, and the first thing I tried to ...
-1
votes
1answer
105 views

script or powershell or batch file to select and connect to a specific SSID [closed]

Is anyone aware of a way in windows 10 to programmatically select (i.e. connect to) a specific SSID/wiFi network? I have a couple of use/test cases where I need to connect to different SSID's at ...
1
vote
0answers
62 views

Identify Hyper-V VM network adapter connected to specific vSwitch

I am trying to identify a specific network adapter connected to the Internal vSwitch, so I can subsequently bind the DHCP server role to that adapter. There are 3 Network Adapters, 2 connected to ...
0
votes
1answer
46 views

Check how long untill being logged off in win7 (from cmd)? [duplicate]

When I was young, I learned a quick way to set a timer to turn off my computer shutdown -f -s -t 3600 That would give me 1 hour until log off and shutdown. I remember in windows xp, there would be ...
1
vote
1answer
296 views

Lenovo BIOS setting using PowerShell

I am trying to change BIOS settings through PowerShell. When I run the below command line, it runs successfully, but when I reboot the PC I see no change in the BIOS settings. the command line: ...
4
votes
1answer
40 views

Avoid creating duplicate Hyper-V switches

I am trying to create a PowerShell script (for learning purposes if anything) to set up a virtual Hyper-V cluster from scratch using the new NanoServer. Its still in its early stages, and I'm learning ...
3
votes
3answers
376 views

Replace app package on Windows 10

I recently updated to Windows 10 Home Build 10586. Some built-in apps, however, appear to have been corrupted. One example being MSN News: I have uninstalled and re-installed these apps several ...
0
votes
1answer
96 views

ICS through powershell

In order to enable ICS through powershell, I used the following: # Register the HNetCfg library (once) regsvr32 hnetcfg.dll # Create a NetSharingManager object $m = New-Object -ComObject ...
0
votes
1answer
232 views

How do I replace the system shell (explorer.exe) with another process in Windows 10?

This is for Windows 10. Is there a way to replace explorer.exe with, for example, a powershell script? I'm looking to start a custom shell application without having to have explorer.exe run in ...
0
votes
0answers
800 views

Remove appx package for all users

Fresh Windows 10 install. Somehow the MSN Weather app became corrupted. (Unable to launch) I removed the app with the following Powershell command: Remove-AppxPackage -Package ...
1
vote
0answers
107 views

Unable to access ElasticSearch on AWS

I am trying to use curl in powershell to access elasticsearch on an AWS instance, with no luck. I can access the instance using putty with no problems, and can successfully run a health check on ...
0
votes
1answer
58 views

Using Powershell To Download Pictures

I'm running Powershell 4.0 and I was wondering, it is possible to automate the task of downloading 5 pictures every day from a site and store them in my downloads folder? I prefer not to use any third ...
-1
votes
1answer
59 views

How can I change the time that an e-mail was received via Microsoft Exchange Server or Microsoft Outlook?

As the question says, how can I change the time that an e-mail was received either via Microsoft Outlook or via Microsoft Exchange Server (as an Administrator account) directly? There are numerous ...
0
votes
1answer
25 views

Variable Appendendage Printing Literal String

I have a variable $emp and an individual folder variable for each employee in this variable. So I have 1) $GeorgeFullSaveDir and 2) $JamesFullSaveDir. Using a foreach loop I iterate the values of ...
0
votes
1answer
46 views

Tail pattern with context in Powershell

If I tail a log like this: gc xxx.log -last 1 -wait | sls -patt 'Exception' -simple | % {write $_.Context.PreContext $_.Line $_.Context.PostContext} it works as expected spitting out lines ...
0
votes
0answers
55 views

How to make program show up on a designated virtual display in Windows 10

So as some of you surely know, in Linux you can open a program directly on a specific display by exporting a variable export DISPLAY=:0.0 and then starting a program. Since Windows 10 also ...
0
votes
0answers
748 views

Windows Store Apps Greyed Out [Windows 10]

All of the windows store apps (store included) are greyed out and when I click them an error comes up that says "There's an error with the app. Contact your system administrator to fix it." The ...
1
vote
1answer
107 views

Robocopy replace same date file move

I'm using robocopy to move data. I want to achieve this IF Source File data (Newer or Same) move/overwrite data Else skip file I need a switch or a way to just excluded newer not newer or same ...
0
votes
1answer
33 views

Filter running processes by digital signature authority

I want to write a script that will kill all processes whose executables are signed by a certain authority. I know how to get the list of running processes, and how to send a filtered list off to be ...
1
vote
1answer
161 views

How to find/export only one value (primary SMTP) from multi-valued Proxy Addresses

I have a script which search values in attribute Company and Proxy Addresses. Get-ADUser -Filter * -SearchBase 'OU=Stu,OU=LOWA,OU=IDLOWA,DC=ad,DC=ju,DC=com' -Properties company,proxyaddresses | ...
2
votes
2answers
355 views

Powershell Script to Export all Devices in Device Manager as tree or list?

With former Windows versions, it was possible to print the information from the Device Manager, but it does not seem possible to do this with Windows 7 any longer. I am looking for a Powershell ...
0
votes
1answer
359 views

Add 'Open Powershell here as admin' option to folder context menu

I have been looking for a way to open an elevated Powershell prompt from Windows Explorer directly, via the context menu of the folder I want to open the prompt in. I'm using Windows 10 and all the ...
0
votes
1answer
78 views

The Windows PowerShell snap-in 'System.Management-Automation' is not installed on this computer

I have Power shell version 4.0 under windows server 2012.. now I run the following powershell command :- $admin = "domain\user" $pwd = "*****" | ConvertTo-SecureString -asPlainText -Force $LiveCred = ...
1
vote
0answers
16 views

Get-VM for a hyper-v , what are the differecnes between VMName & Name

I want to get a list of VMS for a Hyper-V server, so I run the following command , to get the VMs details inside hyper-v server named "hyperV01":- PS C:\Windows\system32> Invoke-Command ...
0
votes
2answers
67 views

Append Variable To String

Can you append a variable to the beginning of a string? I have tried, unsuccessfully to accomplish this. In my sample below, I get the literal value returned, not the two variables combined. ...
0
votes
1answer
123 views

Lost Connectivity to Hyper V Host after Creating External Switch

Background: We had a SAS disk fail that was part of a RAID 10 array. Unfortunately, when it failed, it also kicked its mirrored pair in the SPAN offline as well, meaning the whole array was ...
0
votes
2answers
661 views

Remove-Item : Cannot bind argument to parameter 'Path' because it is null

Good Afternoon I have created the following powershell function script{ param ( [string]$path = {"C:\PowerShellTest\Med Rec\1\", "C:\PowerShellTest\Med Rec\2\", "C:\PowerShellTest\Med ...