Difference between revisions of "Windows Powershell"

From rbachwiki
Jump to navigation Jump to search
(Replaced content with "=POWERSHELL FILEBASED OPERATIONS= = Category=")
Tag: Replaced
 
(13 intermediate revisions by the same user not shown)
Line 1: Line 1:
== Script that create a folder based on today's date, then copy the contents of one folder to another==
=[[POWERSHELL FILEBASED OPERATIONS]]=
<pre>
$datecurrent = get-date -Format MM-dd-yyyy
$apath = "C:\Users\Robert\Desktop\leaves"
$btest = "C:\Users\Robert\Desktop\leaves\pdf-sliced"
$ctest = "C:\Users\Robert\Desktop\leaves\atest"


#create directory
New-Item -ItemType directory -Path "$ctest\$datecurrent"


#open folder
=[[Windows| Category]]=
ii "$ctest\$datecurrent"
 
#copy files
Copy-Item -Path $btest\* -Destination "$ctest\$datecurrent" -Verbose
 
</pre>
 
'''save with .ps1 extension'''
[[Windows| Category]]

Latest revision as of 16:38, 13 October 2021