Skip to content

Commit

Permalink
File Automove
Browse files Browse the repository at this point in the history
  • Loading branch information
lukearp committed Apr 28, 2023
1 parent 6e01984 commit 6ea801d
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 0 deletions.
11 changes: 11 additions & 0 deletions Scripts/File-AutoMove/File-AutoMove.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
param($source,$dest)

while($true)
{
$items = Get-ChildItem -Path $source
foreach($item in $items)
{
Move-Item -Path $item.FullName -Destination $dest
}
Start-Sleep -Seconds 5;
}
9 changes: 9 additions & 0 deletions Scripts/File-AutoMove/ReadMe.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# What does this script do?

Monitors a folder and moves anything that has been written and moves it to a destination folders on the same host.

# Example

```powershell
.\folder-monitor-test.ps1 -source D:\Profile\Documents\Test-Mon\ -dest D:\Profile\Documents\Test-Target\
```

0 comments on commit 6ea801d

Please sign in to comment.