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
11k views

Set-ExecutionPolicy using batch file + powershell script

I'm working on my dotfiles and I'm wanting to create a batch script that will do some initial setup for me when switching to a new computer, like using psget to install modules, etc... I'd also like ...
2
votes
2answers
64 views

How safe is it to enable WinRM / PSRemoting on an internet-facing machine?

How safe is it to make the Remote Powershell (aka PSRemoting) endpoint of a production server accessible from the internet? We're not a bank or anything, but the server does hold sensitive corporate ...
0
votes
0answers
22 views

EventLog Source “Connect”. No events in EventLog

I'm baffled by this, as I can find no documentation on wether or not "Connect" or "Connection" is some kind of registered keyword for EventLog Sources. I'm trying to create an EventLog Source called ...
2
votes
1answer
66 views

How to remove substring in Powershell script

This script is almost what I need: $input_path = 'C:\Common' $output_file = 'C:\Common\extracted.txt' $regex = 'assets' Get-ChildItem -Path $input_path -Filter *.txt | Select-String -Pattern $regex ...
0
votes
1answer
26 views

why is the powershell i can open from the run box not the same thing i can open from the start menu?

If I WinKey + R to open the run box and type powershell it works to some extent as it opens up a command line box. However, this windows doesn't behave like the powershell I can open from Start > ...
2
votes
1answer
56 views

Batch why <nul breaks my file

Well guys i am basically trying to get user input and type it on the batch I will be using backspace and enter so i cant use choice Thats why i am following this method To capture characters as ...
0
votes
1answer
19 views

Exchange Powershell Questions

Goal: Find all mailboxes which have not sent (or received possibly?) mail in the past 90 days. I've seen a few guides on powershell commands but I'm not positive I have the right order (Get-Mailbox | ...
0
votes
2answers
140 views

Wsservice fails while attempting to fix Windows Store 8.1

My Metro Apps are not loading. They return: This App can't run Using this command in Powershell: powershell -ExecutionPolicy Unrestricted Add-AppxPackage -DisableDevelopmentMode -Register ...
1
vote
1answer
44 views

Can't Use Powershell Active Directory Cmdlets Even With RSAT Installed

A while back I wrote a simple .ps1 that let me look up the name of a user or the hostname of a computer and tell me which OU of my AD it resided in. I don't recall having any difficulty running the ...
0
votes
1answer
54 views

Pinning cmd.exe to taskbar actually pins Visual Studio 2010 cmd console

Okay, so I've been having a very strange situation on my home computer. I'm writing a powershell script to do some basic stuff that I do on test rigs at work all the time for setup (create a shared ...
4
votes
2answers
6k views

Convert text files recursively to UTF-8 in PowerShell

I have a folder with text files which includes other folders in it, and these also contain some text files. I need to recursively convert all these files to UTF-8 encoding in PowerShell and preserve ...
-2
votes
1answer
32 views

Powershell script to find the Process and kill the process

I am a begineer in powershell script and trying to make a small powershell script to find the PID by searching the filename and if shows that multiple Pid then take the TOP one and kill that PID.I am ...
10
votes
1answer
7k views

How can I get a property of an object in powershell without using parentheses?

I often find that I have to surround a command in parentheses and then use the property access operator (dot-syntax) to get the value of a property. This is rather annoying since I have to go back to ...
0
votes
2answers
32 views

Windows Explorer Recursive Copy Unknown File Types

I am attempting to move all files (several different types of files, potentially) from a single root directory and all nested folders within the root. There could several different levels of ...
11
votes
3answers
8k 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
21 views

configure temporary account lockout using powershell

My Windows 8.1 laptop does not have gpedit.msc. I want to configure my laptop so that the account is locked for 15 mins if anyone enters the wrong password three times. I have found some web ...
0
votes
2answers
32 views

New to scripting and need help running powershell script to deploy software. (powershell blocked execution) [closed]

The following script was written for me. My problem is that when our remote deployment system executes the script, Powershell on the local machine will not run the script. It has no problem running ...
37
votes
4answers
16k views

Turning off the cmd window beep sound

Is there a way to essentially mute the Beeping function of the Windows command shell? I'm working on a PowerShell script right now which ends up printing several lines of text to the screen. I'm ...
0
votes
0answers
12 views

Tracking Windows Firewall Rules on multiple servers

I have a need to monitor a large number of windows firewall on servers. E.G. Have there been any changes to any of the policy rules in the last month? I have looked into the following question but ...
0
votes
0answers
36 views

Line wrapping in Powershell ISE Console?

I sometimes write long lines of code as I am playing with things in the PowerShell ISE (v4 on Windows 8.1). I find its console window helpful in many ways, but I'm unable to figure out how to make it ...
0
votes
1answer
60 views

Turn ON display with a batch or powershell

We have a computer connected to a large vizio flat screen that displays secure information and it is always on. I have a script running with task scheduler to shut off only the display at a certain ...
3
votes
3answers
12k views

Find AD users with specific AD attribute NOT null

I'm looking for a script/Powershell command that will list all AD users that have a value not NULL in the teletexterminalidentifier attribute, so they must have a value set. By default this attribute ...
0
votes
1answer
228 views

Running runas cmd in Powershell

I am a beginner and am trying to understand how to use the runas command in Windows Powershell. When I type the following command into Powershell: runas /user:\administrator cmd I am asked ...
0
votes
0answers
67 views

Can't click application with Powershell

I am trying to automate clicks on a software for which I do not have the source ... So I do not have a choice. When I execute my code, the mouse moves well, but the clicks do not perform on my ...
0
votes
2answers
39 views

DOS batch variable expansion to give Last Access Time

I'm trying to use a FOR /R loop to iterate over some particularly long-named folders (greater than 260 characters in length, hence the need to use \?\ ) I need out of the loop, the fully qualified ...
0
votes
1answer
318 views

Running batch file on remote machine (VM) using PowerShell

Quick question, have searched for awhile but can't find answer anywhere. Some background: I have a local machine and remote machine (Virtual Machine) that I am connecting through RDP. I have a batch ...
0
votes
1answer
24 views

Storing secure strings during sysprep using Powershell

I have two Powershell scripts I'm building for a Windows 7 image. Prior to the image I run PRE-IMAGE.ps1, and it has a line like this in it: $JoinDomainPassword = Read-Host -Prompt "Please enter the ...
3
votes
1answer
51 views

Bash “command” equivalent in PowerShell

Is there a "command" equivalent of Bash in PowerShell? I used to over-ride certain command in Bash like this: function npm(){ command npm --no-color $@ } I'd like to do the same in PowerShell, ...
0
votes
0answers
39 views

How do I get Bits transfer to download a file for me?

I've been trying to get Windows PowerShell on Windows 7 to download files for me using Bits transfer. The file I was downloading was Marvinbeans 15.1.9.0 from ...
0
votes
1answer
220 views

How to add Active Directory module in PowerShell in Windows 8?

I use Windows 8.1 and I try use Import-Module ActiveDirectory, but I get the following error: PS C:\Windows\system32> Import-Module ActiveDirectory Import-Module : No se cargó el módulo ...
1
vote
1answer
21 views

powershell directory prefixes

What do you call the prefix portion in powershell directory paths? Like for certificates, you can do: cd cert:/path/to/certificate or for registries, you can do: cd HKCU:/path/to/registry/key ...
0
votes
1answer
118 views

Remove cached credentials for MS Onedrive using a script

I have a need to be able to remove onedrive cached credentials from local machines from the windows credential manager using a script The reason - When a user is prompted to change their O365 password ...
0
votes
1answer
44 views

Make Batch file to add special tags at the front of video files at one folder

I always make download for learning tutorials videos , Some times I don't remember where I can find those videos because they are too many , so I decide to make tags to those file and put them in ...
0
votes
0answers
55 views

“Change PC Settings” link doesn't work in Windows 8.1

Okay, Today I've upgraded from Windows 8 to Windows 8.1 through Store, the upgrade finished successfully and installed as well, I tried to open the PC settings from the Charms Bar, when I pressed on ...
0
votes
1answer
69 views

What is the difference between running @powershell and powershell (any command with @ at the front)?

Just installed Chocolatey and in their installation instructions they have @powershell -NoProfile -ExecutionPolicy unrestricted...... I tried to run @cls in my console and it worked too. It's ...
0
votes
2answers
311 views

Use a variable inside a powershell string

I've got this currently on a single line in Powershell ISE Start-Process -filepath "C:\Powershell-Backup\disk2vhd.exe" -argumentlist 'C: \\Computer1\ServerBackups$\' + $ComputerName + '\' $JobTitle + ...
0
votes
1answer
20 views

Writing a script for a multi network student lab to change networks

I work in a university/college and having a problem in one of the labs. At the moment we have a few programs that pull their licences from a licence server. This licence server has no internet ...
1
vote
1answer
57 views

How do you change the default powershell font style?

I'm changing both Powershell and the Windows Command Prompt to use Ubuntu Mono has the default font. After installing the Ubuntu Mono Font Family and modifying the registry, both consoles pick up ...
1
vote
1answer
28 views

Find out the depth of path in PowerShell

For any location gotten by the Get-Location cmdlet, if I have a path like this: C:\Top\Middle\Bottom I would say it's 3 levels deep. If I have: C:\ I would say it's the 0 level. It could be 0 ...
1
vote
0answers
79 views

Windows Activation Powershell Script

I'm looking for a method to automate activation Windows 7 machines through PowerShell. We get approximately 50 computers a month and it's slowly increasing, so manual activation is no longer possible ...
0
votes
1answer
70 views

I installed a python package on Windows using pip. Why can't I call it from the command line?

In Powershell I installed boto-rsync using pip: PS> pip install boto-rsync That installed boto-rsync in C:\python27\Scripts as 'boto-rsync' as expected. I have C:\python27\Scripts in the path ...
1
vote
1answer
63 views

Download files from web, unknown name of file

I need to download 10-15 programas every week, and looking how to automate the process. It's easy when I know exactly the name of .exe file; but what about the case when I dont? For example, lets ...
0
votes
2answers
35 views

PowerShell with Tabs Window Management

Is there a way to run one powershell window and have multiple tabs in this window that you can jump between without have several powershell windows open?
0
votes
0answers
64 views

Set-AzureStorageAccount - GeoReplicationEnabled parameter will be deprecated in a future release

I get the following warning in powershell for this command: Set-AzureStorageAccount -StorageAccountName $storageAccount -GeoReplicationEnabled $false WARNING: GeoReplicationEnabled parameter ...
0
votes
1answer
315 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
1answer
167 views

Automatically retrieve a set of files from all domain computers

Is there any PowerShell script or piece of free or commercial utility software that could be run on a server on demand and which would copy a particular set of files from a particular location on all ...
0
votes
0answers
11 views

automate forefront identity manager 2010 with Power Shell

I have a VM running server 2012 with MS Forefront identity Manager 2010 R2 with the purpose of syncing our on prem AD to azur AD for office 365 Every 3 hours the service runs Active Directory ...
0
votes
1answer
20 views

Why does Console2 return the cursor at weird offsets?

Since I have insufficient reputation to post images, here is a screenshot where I type "quit" repeatedly within ghci. This behavior occurs when using both PowerShell and cmd.exe. The settings for ...
0
votes
2answers
70 views

How to get serial number of drive in storage pool

I have a storage pool in windows 8.1 and notice that whenever I boot the computer, it hangs for a long time in the detecting IDE drives during post. When it finally gets into windows, it shows one of ...
1
vote
2answers
2k views

Change to home directory in PowerShell

At the cmd command prompt, this command will take me to my home directory: cd %UserProfile% At the PowerShell command prompt, the same command produces this error: Set-Location : Cannot find path ...