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
1answer
12 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 ...
0
votes
1answer
13 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
1answer
37 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 ...
1
vote
1answer
11 views

How do I permanently remove a default Powershell alias?

For some unknown reason, the devs included "curl" as an alias for Invoke-WebRequest, even though it is not compatible with the proper implementation of curl, which means it gets in the way when I try ...
0
votes
0answers
25 views

Truncate a log file by datetime using Powershell 2.0

We have a simple log file. It gets too big or the entries irrelevant as they age. Entries have a datetime prefix similar to this: 01/22/15 01:54:17 -I- Start processing stuff Occasionally the ...
0
votes
1answer
26 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
43 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 ...
1
vote
1answer
8 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
26 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
20 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
31 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
36 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 ...
0
votes
0answers
11 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 ...
2
votes
2answers
29 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 ...
4
votes
3answers
85 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 ...
1
vote
0answers
23 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
34 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 ...
0
votes
0answers
16 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
33 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
17 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
0answers
20 views

Windows 8.1: move/rename online-only files in OneDrive from a Cygwin shell

I'm trying to batch rename some online-only files in OneDrive from a Cygwin shell (with a beefed-up version of Larry Wall's rename script, in case you're interested). That won't work; I figured that ...
0
votes
1answer
28 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)
1
vote
1answer
27 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 ...
1
vote
0answers
22 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 ...
0
votes
1answer
34 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
0answers
27 views

Excel VBA that calls Powershell ActiveDirectory cmdlet, but Module won't load?

I have a powershell script I use to dump user and computer lists to csv files; it works great and I don't want to touch it much. It uses the ActiveDirectory cmdlet, and the Get-ADComputer and ...
1
vote
0answers
25 views

Get Network Printers From A Remote Computer

I am using this to attempt to get a list of printers on a remote computer: Get-WmiObject win32_printer -ComputerName "$oldPcName" The problem is I only get local printers, not those printers from ...
2
votes
2answers
26 views

Temporary Password for Domain Admin

A small non-profit company handling confidential information must grant remote domain admin access to their external IT services provider who manages the entire network, including new PCs, etc... ...
1
vote
1answer
20 views

Why does powershell launch tiny?

My powershell window launches tiny, despite the defaults being fine. To adjust I have to go into properties for the window, which fixes it but also displays an error. What can I do to have it ...
0
votes
1answer
11 views

How to replace text in last column?

Is there an easy way how to convert text in last column(8) if last 3 characters of the string are "-TA" So for example if text string in last column is "AB-TA" it will convert text to "AB.NO" If the ...
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
76 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
1answer
37 views

Split large text file according to record values

There are some questions alike in this site, but mine is a bit different. I have a 30 GB text file, and I need to split it into smaller files according to the different record values. For example; ...
1
vote
1answer
43 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 ...
0
votes
1answer
47 views

using powershell, is it possible to convert an XLSX file to XLS?

As the title states, is this possible? I found some scripts for XLS to XLSX, but not the other way around. Can this be done with powershell? Thanks
0
votes
0answers
16 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 ...
1
vote
1answer
39 views

Zipping Sub-folders

I want to use 7-Zip to zip subfolders to another folder on the same drive. Each sub-folder has zillions of text files. I just want to zip subfolder as a whole via Powershell. I have a script but ...
2
votes
2answers
48 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 ...
2
votes
0answers
36 views

Deploying Server 2012 with DNS role using WDS and answer file [migrated]

I want to deploy an image using wds on server 2012. I will be using an answer file for unattended installation with little touch as possible. My answer file works great but I can't get the auto-logon ...
0
votes
1answer
23 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
35 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 ...
1
vote
3answers
57 views

How to open a second PowerShell console window from start screen?

I pressed Win and typed in "PowerShell". However, since there's already a PS console window open, the computer switched the focus to it, instead of, as I intended, open a new one. How can I open a ...
2
votes
1answer
44 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
17 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 | ...
1
vote
1answer
29 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 ...
2
votes
1answer
33 views

How to change date format in multiple text files in powershell?

Hello I have around 5000 text files (TXT) in one directory.Files are comma delimited. What I'm trying to do is to change date format (it is stored in first column of each file) from M/d/yyyy to ...
0
votes
2answers
94 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 ...
-2
votes
1answer
28 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 ...
0
votes
1answer
46 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 ...
0
votes
2answers
26 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 ...