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

Unable to delete .swp file

I'm using Vim on Windows 7 Enterprise. Vim sometimes creates an .swp file. After closing Vim, this file sticks around. I would like to delete it. However, I receive the following error: ri : Cannot ...
1
vote
2answers
44 views

Bulk Folder Renaming Powershell Script

The script below is used for Bulk Folder Renaming. However I wanted to make this as a Generic Script so users can give input and use it accordingly. This script has 3 inputs a) Enter the Source ...
1
vote
1answer
58 views

Robocopy Log File Meaning of New File, New Dir

I've been learning and using robocopy a lot for the last few weeks. One thing I have not been able to find is good documentation on the terms used in the default log file. There is no header row in ...
0
votes
0answers
15 views

Copy from SFTP to local host using Username/ privatekey.ppk using powershell

would you please help me , i need script that copy files from FTP server to local host using only Username and .ppk as a private key , i don't have password. is it possible to do that. Please ...
1
vote
1answer
40 views

Can robocopy show the console and create a log file?

I'm working with robocopy for the first time and have got most of it figured out and working well except logging. I have experimented a bunch and if I run my job like this: robocopy /xc /xn /xo ...
0
votes
2answers
52 views

Detect powershell function input is redirected

I have a subprocess that I want to call from powershell that might be interactive or I might pipe data straight into it. For example: # This is interactive: & c:\python27\python.exe # This takes ...
0
votes
1answer
32 views

Why does $_.Name include full path when within quotes in Powershell?

When I run this in powershell it outputs the name of my files (in this case just one), without full path: PS C:\dev\temp> gci test.* | % { $_.Name } test.txt When I put the name in quotes for ...
0
votes
0answers
82 views

schtasks.exe - Start At Login, Run Every Minute

I'm having trouble getting schtasks.exe to create a Sheduled task that will: Start at logon Repeat at minute intervals I've tried the following: schtasks /Create /SC MINUTE /MO 1 /TR ...
0
votes
0answers
40 views

Powershell not recognizing Commands

I'm a beginner in PowerShell, I've been working with it for a little while, but suddenly it started not recognizing some commands, for example , typing the Command Set-Location, generates this error : ...
0
votes
1answer
36 views

PSModule provider is missing

I recently installed Windows 10 on my laptop. Problem is that I cannot install apps from OneGet because I cannot install Chocolatey source because PSModule provider is missing. Screenshot: Click for ...
1
vote
2answers
87 views

Remove bracket characters in filenames using Powershell

I have a large document library stored on a Sharepoint server which has been migrated over from an old Access database, versioning of these documents was controlled by the user and appended at the end ...
1
vote
0answers
25 views

In >= Windows 8, how might I return all MSMQ Journal entries for named Queue in powershell?

As introduced in MSMQ Cmdlets (https://technet.microsoft.com/en-us/library/hh405007(v=vs.85).aspx), we now have the ability to query our queue. If I run PS C:\Get-MsmqQueue Then I get a full list ...
0
votes
1answer
37 views

passing value from powershell script to cmd script

I want to pass value “200001” from the PowerShell to cmd script “1%” The cmd script used by multiple powershell scripts, and each PowerShell script has its own value. PS script: function ...
1
vote
1answer
70 views

Need help writing a Powershell script to automate a silent install of Avamar Client on multiple machines

I am writing a Powershell script to automate a silent install of Avamar Client on multiple machines. Here is the script that I have written so far, but it keeps coming up with errors: #Variables ...
0
votes
1answer
21 views

Issues with Powershell variables/expressions

I'm trying to build a Get-Winevent command using variables, but I'm having issues with variables inside "built" commands and I've hit the proverbial brick wall. On the last bit of code, if I remove ...
0
votes
0answers
37 views

Can't install local copy of MSI with msiexec, but can over the network with psexec

I'm not sure why this is the case, but I can't install a local copy of a MSI if I remote into the machine in PowerShell with msiexec. I get this error: [computername]: PS C:\temp> msiexec -q -i ...
0
votes
0answers
39 views

Is there a Powershell remoting equivalent of using psexec as the system account?

PSEXEC has a -s argument that will "Run the remote process in the System account." I'm currently using a Powershell remoting session as follows: $s = New-PSSession -computerName $server The user ...
1
vote
2answers
81 views

Change Powershell Execution Policy silently from Batch script

I would like some help on setting a registry value for powershell. The path is [hkey_local_machine\system32\windows\microsoft\powershell\1\shellids\microsoft.powershell] ...
0
votes
2answers
64 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
32 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
59 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
191 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
4answers
213 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
11 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
54 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
92 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
75 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
82 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
50 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
117 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
39 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
133 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
150 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
101 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
76 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
178 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
55 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
51 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
151 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
42 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
50 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
77 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
149 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
51 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
38 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
44 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
40 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
73 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
107 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
43 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 ...