]> apps.delaporte.us Git - dotfiles.git/commitdiff
Helper scripot
authorEdward Delaporte <delaport@illinois.edu>
Fri, 7 Jun 2024 17:48:08 +0000 (12:48 -0500)
committerEdward Delaporte <delaport@illinois.edu>
Fri, 7 Jun 2024 17:48:08 +0000 (12:48 -0500)
psmodules/backup_to_smb.psm1 [new file with mode: 0644]

diff --git a/psmodules/backup_to_smb.psm1 b/psmodules/backup_to_smb.psm1
new file mode 100644 (file)
index 0000000..926d048
--- /dev/null
@@ -0,0 +1,12 @@
+function Backup-ToSMB {
+    param (
+        $Path,
+               $SMBPath,
+               [PSCredential] $Credential,
+               $DriveLetter = 'N'
+    )
+       New-PSDrive -Name $DriveLetter -PSProvider FileSystem -Root $SMBPath -Credential $Credential
+       robocopy $Path $SMBPath
+
+}
+Export-ModuleMember -Function Backup-ToSMB
\ No newline at end of file