<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://www.r512.com/index.php?action=history&amp;feed=atom&amp;title=POWERSHELL_FILEBASED_OPERATIONS</id>
	<title>POWERSHELL FILEBASED OPERATIONS - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://www.r512.com/index.php?action=history&amp;feed=atom&amp;title=POWERSHELL_FILEBASED_OPERATIONS"/>
	<link rel="alternate" type="text/html" href="https://www.r512.com/index.php?title=POWERSHELL_FILEBASED_OPERATIONS&amp;action=history"/>
	<updated>2026-04-03T17:47:57Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.37.1</generator>
	<entry>
		<id>https://www.r512.com/index.php?title=POWERSHELL_FILEBASED_OPERATIONS&amp;diff=2818&amp;oldid=prev</id>
		<title>Bacchas at 17:50, 17 October 2024</title>
		<link rel="alternate" type="text/html" href="https://www.r512.com/index.php?title=POWERSHELL_FILEBASED_OPERATIONS&amp;diff=2818&amp;oldid=prev"/>
		<updated>2024-10-17T17:50:05Z</updated>

		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Revision as of 17:50, 17 October 2024&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l59&quot;&gt;Line 59:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 59:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;$Eject.NameSpace(17).ParseName($vol.driveletter).InvokeVerb(“Eject”)&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;$Eject.NameSpace(17).ParseName($vol.driveletter).InvokeVerb(“Eject”)&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;/pre&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;/pre&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;==[[&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Windows&lt;/del&gt;| &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Windows &lt;/del&gt;Category]]==&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;==[[&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Main_Page| Home]] - [[PowerShell&lt;/ins&gt;|Category]]==&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Bacchas</name></author>
	</entry>
	<entry>
		<id>https://www.r512.com/index.php?title=POWERSHELL_FILEBASED_OPERATIONS&amp;diff=2650&amp;oldid=prev</id>
		<title>Bacchas at 14:58, 26 April 2023</title>
		<link rel="alternate" type="text/html" href="https://www.r512.com/index.php?title=POWERSHELL_FILEBASED_OPERATIONS&amp;diff=2650&amp;oldid=prev"/>
		<updated>2023-04-26T14:58:02Z</updated>

		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Revision as of 14:58, 26 April 2023&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l59&quot;&gt;Line 59:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 59:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;$Eject.NameSpace(17).ParseName($vol.driveletter).InvokeVerb(“Eject”)&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;$Eject.NameSpace(17).ParseName($vol.driveletter).InvokeVerb(“Eject”)&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;/pre&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;/pre&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;==[[Windows| Windows Category]]==&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Bacchas</name></author>
	</entry>
	<entry>
		<id>https://www.r512.com/index.php?title=POWERSHELL_FILEBASED_OPERATIONS&amp;diff=2068&amp;oldid=prev</id>
		<title>Bacchas: Created page with &quot; == Script that create a folder based on today&#039;s date, then copy the contents of one folder to another== &lt;pre&gt; $datecurrent = get-date -Format MM-dd-yyyy $apath = &quot;C:\Users\Jo...&quot;</title>
		<link rel="alternate" type="text/html" href="https://www.r512.com/index.php?title=POWERSHELL_FILEBASED_OPERATIONS&amp;diff=2068&amp;oldid=prev"/>
		<updated>2021-10-13T16:38:15Z</updated>

		<summary type="html">&lt;p&gt;Created page with &amp;quot; == Script that create a folder based on today&amp;#039;s date, then copy the contents of one folder to another== &amp;lt;pre&amp;gt; $datecurrent = get-date -Format MM-dd-yyyy $apath = &amp;quot;C:\Users\Jo...&amp;quot;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;&lt;br /&gt;
== Script that create a folder based on today&amp;#039;s date, then copy the contents of one folder to another==&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$datecurrent = get-date -Format MM-dd-yyyy&lt;br /&gt;
$apath = &amp;quot;C:\Users\John\Desktop\leaves&amp;quot;&lt;br /&gt;
$btest = &amp;quot;C:\Users\john\Desktop\leaves\pdf-sliced&amp;quot;&lt;br /&gt;
$ctest = &amp;quot;C:\Users\john\Desktop\leaves\atest&amp;quot;&lt;br /&gt;
&lt;br /&gt;
#create directory&lt;br /&gt;
if ( -not (Test-Path &amp;quot;$ctest\$datecurrent&amp;quot; -PathType Container) ){&lt;br /&gt;
New-Item -ItemType directory -Path &amp;quot;$ctest\$datecurrent&amp;quot;&lt;br /&gt;
}else{&lt;br /&gt;
&amp;quot;Directory already exist! Maybe you ran the program twice&amp;quot;&lt;br /&gt;
Read-Host -Prompt &amp;quot;Hit Enter to Exit&amp;quot;&lt;br /&gt;
break&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
if( Test-Path &amp;quot;$ctest\$datecurrent&amp;quot; -PathType Container ){&lt;br /&gt;
#open folder&lt;br /&gt;
ii &amp;quot;$ctest\$datecurrent&amp;quot;&lt;br /&gt;
#copy files from source to destination&lt;br /&gt;
Copy-Item -Path $btest\* -Destination &amp;quot;$ctest\$datecurrent&amp;quot; -Verbose&lt;br /&gt;
&lt;br /&gt;
}else{&lt;br /&gt;
&amp;quot;There Was an error - Contact Robert&amp;quot;&lt;br /&gt;
}&lt;br /&gt;
Read-Host -Prompt &amp;quot;Hit Enter to Exit&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;save with .ps1 extension&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
== Copy all files with specific extension ==&lt;br /&gt;
 $datecurrent = get-date -Format MM-dd-yyyy&lt;br /&gt;
 $atest = &amp;quot;C:\Users\Robert\Desktop\leaves&amp;quot;&lt;br /&gt;
 $ctest = &amp;quot;C:\Users\Robert\Desktop\leaves\atest&lt;br /&gt;
&lt;br /&gt;
 Get-ChildItem -Path &amp;quot;$atest\*&amp;quot; -Include *.pdf -Recurse | Copy-Item -Destination &amp;quot;$ctest\$datecurrent&amp;quot; -Verbose&lt;br /&gt;
&lt;br /&gt;
== CD  to a specific directory ==&lt;br /&gt;
 set-location &amp;#039;g:\box\All Flds\web\amazon\test&amp;#039;&lt;br /&gt;
== Search for Multiple files==&lt;br /&gt;
 Get-ChildItem | Where-Object {$_.Name -like &amp;quot;*catch*&amp;quot; -or $_.Name -like &amp;quot;*dream*&amp;quot; -or $_.Name -like &amp;quot;*david*&amp;quot;} &amp;gt; output.txt&lt;br /&gt;
&lt;br /&gt;
== Find multiple files then move them to a directory ==&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$filesfound = Get-ChildItem | Where-Object {$_.Name -like &amp;quot;*catch*&amp;quot; -or $_.Name -like &amp;quot;*dream*&amp;quot; -or $_.Name -like &amp;quot;*david*&amp;quot;}&lt;br /&gt;
&lt;br /&gt;
foreach ($file in $filesfound){&lt;br /&gt;
    $parent = Split-Path $file.fullname -Parent&lt;br /&gt;
    Move-Item $file.fullname -Destination $parent\test&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Eject Drive *Not tested==&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$vol = get-wmiobject -Class Win32_Volume | where{$_.drivetype -eq &amp;#039;2&amp;#039;}  &lt;br /&gt;
$Eject =  New-Object -comObject Shell.Application&lt;br /&gt;
$Eject.NameSpace(17).ParseName($vol.driveletter).InvokeVerb(“Eject”)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;/div&gt;</summary>
		<author><name>Bacchas</name></author>
	</entry>
</feed>