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

How to recursively delete all .DS_STORE files from a directory on a Windows Machine?

I extracted a .zip file compressed on a Mac and discovered that the compression included all the .DS_STORE meta-directory files (I think used to speed up spotlight search, but besides the point?). Is ...
0
votes
1answer
10 views

Parameters with spacebars parsed incorrectly for a powershell script run from a batch file

I have a batch file that runs a powershell script and I need to pass two parameters to the script. In my batch it looks like this: powershell -executionpolicy remotesigned -File "my script.ps1" "my ...
0
votes
0answers
27 views

PowerShell script is interrupted by a automatic reboot during unattend Windows installation

I have a problem during the unattended installation of Windows 7. I'm using an unattend.xml file to install Windows. In the unattend.xml, there are RunSynchronousCommand statements to run a PowerShell ...
1
vote
1answer
11 views

“invoke-command” using wusa.exe in powershell - won't install the msu

I'm attempting to push a windows hotfix to a number of computers on our network, using PowerShell v3. I've downloaded the appropriate .msu file, I've been able to successfully install it from the ...
1
vote
1answer
29 views

Moving a folder across the network

I need to move (not copy then delete, for the sake of file verification) a folder from a network folder to another network folder using Powershell. I have tried Move-Item (where test1 is a folder): ...
0
votes
0answers
9 views

How to control speed on Copy Paste [duplicate]

My situation is the speed of syncing files through vpn need to be controlled to 500K. I have couple of scripts running on schedule using powershell, robocopy. The process is basically just a copy and ...
-1
votes
4answers
37 views

Path error in script

I am Googling scripts to find a PS script to count file types and files in several directory's on our network. I have several directory's on my "Libraries" directory on my PC at work. I'm just ...
-1
votes
1answer
16 views

Set “deny log on locally” in Powershell?

Using powershell in Server 2008 R2, how to set the Deny Log On Locally policy for my domain?
1
vote
2answers
37 views

Copy all files with a certain name using Powershell

I'd like to find and copy all the files in a certain directory and all it's sub-directories with a particular name. I'm using Copy-Item in Powershell (technet | ss64) Here's what I have: Copy-Item ...
0
votes
2answers
69 views

Replace files smaller than 1KB from backup

I need to use backups to replace corrupted files on a shared folder. All corrupted files are fixed size = 1KB and have the archive flag set. Basically, I'd like to replace files in the destination ...
1
vote
1answer
10 views

Using atom as text editor for Github for Windows

small question, I use atom text editor, today I installed Github for windows. Since all my commits messages triggered notepad.exe, I used the following line to change my global editor: git config ...
-1
votes
1answer
34 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
23 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
36 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
45 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
48 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
25 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
71 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
15 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
23 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
54 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
30 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: ...
1
vote
2answers
36 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
66 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
58 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
32 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
25 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
20 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
26 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
34 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
58 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
30 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
54 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
54 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
57 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
17 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
30 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
39 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
57 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
13 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
36 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
93 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
40 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
20 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
37 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
32 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
34 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
32 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 ...