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
votes
1answer
83 views

how to copy files from SFTP to local host(windows server) using powershell

I am using the below power shell command to copy file from server "SFTP" to windows server. for some reason the Script is not working would you please help # Scriptname.ps1 # send the files to ...
0
votes
1answer
35 views

Powershell - select and update an attribute “on the fly”

I am trying to look for AD users who have an null attribute ("terminalservicesprofilepath") and to update this attribute in the same command. I can select the users, but how to update the attribute ...
0
votes
2answers
71 views

Find group of words in a text file and extract the line to new text file

my file ref.txt contains word "hi" "hello" "aloha" as per below: hi hello aloha And I have one more file abc.txt which contains many words including the above 3 words. Now I developed a ...
-2
votes
2answers
85 views

Using PSexec to launch PowerShell session as system with specific window attributes

I'm trying to launch a PowerShell session via PSexec with alternate colors and some window attributes. The reason why I would need to run PowerShell through PSExec is so that I can have a ready-made ...
0
votes
1answer
87 views

How to use Powershell command invoke-sqlcmd in batch script

I have a Powershell command that I want to be run in a batch script. It works well in the Powershell console, but I cannot call it properly in batch script. The Powershell command goes like this: ...
0
votes
0answers
48 views

How Can i Remotely Install .inf file for FLT Driver

I am using power shell to execute the install.bat on remote machine that install the filter driver. Prob: Script operations such as set registry key executes remotely but .inf file for driver ...
0
votes
1answer
137 views

Powershell - Copy-Item to a remote share path error illegal characters in path

OK, the real problem was that I was getting the path from a registry entry and then cleaning it with Regex. The very start of the path had a space in the front which I did not notice the way I was ...
0
votes
0answers
35 views

How to make a github commit be authored by “unknown”/“unrecognized author”?

For fun I'm trying to create an awful git command called "git shove" that basically does this: git add -A git commit -a -m "git shoved" git push --force I would like it also so that the author is ...
0
votes
1answer
35 views

Powershell No Logon Servers Available

I have one deployment server A, my local machine B and the server I'm accessing C. When I'm running a test script from B -> C it's successful. When I'm running that same script from A -> C it fails, I ...
0
votes
1answer
111 views

Powershell Folder monitor/batch execution

I am new to Powershell. I have found a script that works with what I need, kind of. What I am looking for is a script to monitor a folder for specific file names/types. Depending on the file ...
1
vote
0answers
37 views

Issues Adding Data to an XML Document w/PowerShell

Trying to add an element to an existing XML file using PowerShell. I have looked at several examples and my 'add' script works but, it is misplacing the element. Sample of XML I am using: ...
2
votes
2answers
44 views

Run Powershell script when you open Powershell

Is it possible to run a Powershell script when you run Powershell? As in, double click the Powershell icon and open the window. Is there some type of "auto-run" setting somewhere?
0
votes
1answer
74 views

Is there a Window's Command Line Option to Show the Sizes of Directories

When I do a dir command it, gives this information: 02/11/2015 01:39 PM <DIR> bar 11/11/2014 07:22 AM <DIR> buz 02/12/2015 01:35 PM 140,660,736 foo.sdf ...
0
votes
1answer
114 views

In ConEmu / Cmder, how do you setup ConEmu Here to work with powershell?

I am trying to get the ConeEmu Here context menu item to work everywhere in windows explorer. Settings -> Integration -> ConEmu Here -> Command Currently I have: ...
0
votes
0answers
43 views

Reflect HKLM/SOFTWARE/Policies registry changes to HKCU/Software/MS/Win/CV/GPOs

Ok so I have a Local Group Policy (under Computer Config, not User Config) to force install extensions in Chrome. This policy needs to run for every user of the computer. The value is going to change ...
0
votes
0answers
31 views

Why does PowerShell give “Access Denied” for Get-Content on a directory?

By accident, I recently tried running Get-Content on a directory. I'd initially thought it was a file because it was named very similarly to a common file I'd expected to be in the location. So I was ...
0
votes
0answers
27 views

Windows PowerShell - SqlServerCmdletSnapin100 Error

I am trying to run the following command through my winodws powershell: Add-PSSnapin SqlServerCmdletSnapin100 But I get the following error: How can I install SqlServerCmdletSnapin100? I can't ...
0
votes
1answer
37 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 ...
1
vote
1answer
59 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
82 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
3answers
36 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
1answer
72 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
91 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
71 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
36 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
35 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
25 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
53 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
88 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
14 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
45 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
103 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
25 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
43 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
29 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
46 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
68 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 ...
0
votes
1answer
47 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
39 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
45 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
71 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
77 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
1answer
168 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
42 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
25 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
15 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
286 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
56 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
73 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 ...