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
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 ...
1
vote
1answer
26 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
16 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 ...
0
votes
0answers
15 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 ...
1
vote
1answer
5 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
24 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
17 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
28 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
34 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
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 ...
2
votes
1answer
130 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
24 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
10 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 ...
4
votes
2answers
76 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
32 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
64 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
31 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
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 ...
0
votes
2answers
4k views

How to reset TCP/IP on Windows 8.1?

The following netsh command is not working on Windows 8.1. netsh int ipv4 reset It give “Access Denied” error and it is a VERY known issue, many people complaining about it all ove online forums. ...
1
vote
1answer
29 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
15 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
582 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
456 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 ...
0
votes
1answer
3k views

Call PowerShell script from Excel macro

I'm trying to call a PowerShell script from a macro in Excel. I have seen a number of examples along the lines of: retval = Shell("powershell ""C:\MyTest.ps1""", 1) When I try to use this, ...
3
votes
2answers
3k 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
30 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
86 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
69 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
21 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
2answers
3k views

Download entire directory from a website using Powershell

I have been using the following command to pull back files from a web server and store them on my local machine: $client = New-Object System.Net.WebClient ...
-2
votes
0answers
19 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 ...
-1
votes
0answers
11 views

I want to move number of file for which I am using a loop but I get this Error [closed]

: Cannot convert 'System.Object[]' to the type 'System.String' required by parameter 'Destination'. Specified method is not supported. $year = 1985..2007 Foreach ($i in $year) { start ...
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
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
1answer
25 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
42 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 ...
1
vote
0answers
23 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 ...
2
votes
2answers
24 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
0answers
23 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 ...
1
vote
1answer
34 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
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
9 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 ...
2
votes
1answer
30 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
1answer
44 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
1
vote
1answer
31 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 ...
3
votes
2answers
10k 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 ...