https://github.com/bishal0602/plug-n-copy
Powershell script that automatically detects and copies files from a USB when plugged in
https://github.com/bishal0602/plug-n-copy
cim common-information-model powershell usb
Last synced: over 1 year ago
JSON representation
Powershell script that automatically detects and copies files from a USB when plugged in
- Host: GitHub
- URL: https://github.com/bishal0602/plug-n-copy
- Owner: bishal0602
- Created: 2023-06-02T18:18:12.000Z (about 3 years ago)
- Default Branch: main
- Last Pushed: 2023-11-13T15:52:10.000Z (over 2 years ago)
- Last Synced: 2024-01-29T11:37:38.231Z (over 2 years ago)
- Topics: cim, common-information-model, powershell, usb
- Language: PowerShell
- Homepage: https://www.powershellgallery.com/packages/Plug-n-Copy/1.0.1
- Size: 7.81 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Plug-n-Copy
Plug-n-Copy allows you to secretly copy files from a USB drive to a destination folder when it's plugged in.
---
## Project Structure
```
Plug-n-Copy
├── Scripts
├ ├── Register-PlugNCopy.ps1
├ ├── Unregister-PlugNCopy.ps1
├── Plug-n-Copy.psd1
├── Plug-n-Copy.psm1
├── README.md
```
---
## Usage
1. **Install the Plug-n-Copy module from Powershell Gallery** by running the following command:
```powershell
Install-Module -Name "Plug-n-Copy"
```
2. **Register USB monitoring and file copying**:
```powershell
Register-PlugNCopy -Destination "C:\Destination"
```
The `-Destination` parameter specifies the destination folder where the files will be copied. The `-ShowMessage` switch can be used to display the file copied message on the terminal.
3. **Plug in a USB drive.** The module will detect the connection and copy the files to the specified destination folder.
4. When you're done, **unregister USB monitoring** and clean up variables:
```powershell
Unregister-PlugNCopy
```
Enjoy using Plug-n-Copy!
## Additional Details
For more details on the parameters and usage, run:
```powershell
Get-Help Register-PlugNCopy -Detailed
```