Quantcast
Channel: Powershell Copying
Viewing all articles
Browse latest Browse all 2

Powershell Copying

$
0
0

I am trying to write a script to search my c:\ drive for all files that end in .pem. Once found I want to not only put them into a variable for use later in the script but also copy them into a directory. I think I am close  the syntax but I am messing something up I am new to scripting with and any help is appreciated 

Get-ChildItem -Path c:\ -Recurse -Name *.pem | Copy-item -Path c:\Program Files\files\

I've also tried this way as well


foreach ($pem in (Get-ChildItem -Path c:\ -Recurse -Include *.pem)) {Copy-Item -Path C:\OpenSSL-Win64\bin\pemfolder\}









Viewing all articles
Browse latest Browse all 2

Latest Images

Trending Articles





Latest Images