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
10 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
10 views

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

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 ...
0
votes
0answers
4 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
0answers
8 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
1answer
30 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 ...
0
votes
0answers
23 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
28 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
0answers
22 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 ...
3
votes
1answer
38 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, ...
1
vote
1answer
19 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
46 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 ...
0
votes
1answer
24 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 ...
1
vote
0answers
36 views

Powershell Window Tiny at High Resolution

I have recently bought a Lenovo Yoga 3 ultrabook which has a screen resolution of 3200 x 1800. My cmd window and Powershell window are tiny at this resolution. I have changed the size of the normal ...
0
votes
0answers
37 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
36 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
1answer
45 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
25 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
18 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
31 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 ...
0
votes
0answers
20 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 ...
1
vote
1answer
24 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
42 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
2answers
31 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
15 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
76 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 ...
1
vote
1answer
54 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
1answer
32 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 ...
0
votes
0answers
5 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
19 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 ...
0
votes
1answer
15 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
56 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 ...
0
votes
1answer
77 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 ...
2
votes
1answer
68 views

How to know the file history that has been transferred from pc to usb device or vice versa? [duplicate]

When I want to know that if any usb device that has been plugged in a pc recently, I write this command in Windows Powershell. Get-ItemProperty -Path HKLM:\SYSTEM\CurrentControlSet\Enum\USBSTOR\*\* | ...
0
votes
2answers
41 views

How can I remove all but last 10 characters in a group of files

How can I rename a group of files like admin_ball_126608454.gma another_thing_384157357.gma to ds_126608454.gma ds_384157357.gma
0
votes
1answer
37 views

Rename a file and add a part of the file as the suffix of the file [duplicate]

I have file names like: A_20141001_20141224.txt A_20141002_20141224.txt B_20141001_20141224.txt B_20141002_20141224.txt C_20141001_20141224.txt C_20141002_20141224.txt I want to rename them to: ...
-2
votes
1answer
42 views

PowerShell: find line but include proceeding and preceding line(s)

This is a conceptual question that I have only briefly thought through my head. I have idea how I might do it but it seems more complicated than I think I will make it out to be. A common need is for ...
0
votes
0answers
18 views

How do I regain connectivity to a Windows Server after calling Powershell cmdlet Remove-NetFirewallRule?

I have some servers on AWS cloud. I accidentally invoked the PowerShell command Remove-NetFirewallRule and this has completely locked me out of the server. The server is joined to a domain. I have ...
1
vote
1answer
53 views

Self destruct directory

I would like running a script in a directory and then delete the directory, sub-directory and files. If(Test-Path -Path $var_InterventionManuelle) {Remove-Item -Recurse -Force ...
1
vote
0answers
69 views

How do I gain access to my C: Drive after completely locking it down?

I know the title might seem completely ridiculous but please read this before being biased. Okay, so I got myself into a real squeeze. I installed windows 10 technical preview for Enterprise on a ...
0
votes
1answer
40 views

Powershell script to open random video

I was looking for a way to open random video file in my folder which has about 400 videos (20 videos in 20 subfolders). I found a powershell script and managed it to work, but every time I run it I ...
0
votes
3answers
84 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
0answers
36 views

Powershell Refresh Script

This is a fairly simple script, but it doesn't always work. It worked once today, the first time I ran it. I believe it isn't opening the files in the path I specified on subsequent runs. I'm not ...
0
votes
1answer
52 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
24 views

Invoke-item equivalent in git-bash?

Powershell allows you to open a GUI folder with the invoke-item command. Say I'm in C:\Family\Desktop, the command "invoke-item adam" allows me to open a GUI version of the adam folder. I've tried ...
0
votes
1answer
18 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
24 views

How to remove a picturebox from a powershell GUI after it has been added?

I am creating a powershell tool that performs a specific migration of program data. One step I need to perform is to check whether SQL server can write to the specified file locations. I have a button ...
2
votes
2answers
43 views

Wait for process to exit using powershell

I had a little program in F# (similar to C#), that gets processes by name, then filters the particular one by its path and waits for it to exit: let processes = ...
1
vote
1answer
101 views

Loop through files and remove part of filename

I need to remove the first 3 chars of every file in my directory. Here is my code: Get-ChildItem "D:\New Folder" -Filter *.txt | foreach-object -process {rename-item -path $_.FullName -newname ...
0
votes
1answer
37 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
2answers
24 views

Powershell - Start Process on Different Drive from Batch CMD

Problem: From the CMD or Batchfile, calling powershell and starting a process from a different drive or the -FilePath is failing.