-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Updated README and added an illustration
- Loading branch information
Showing
2 changed files
with
70 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,71 @@ | ||
# removable-read-only | ||
A small script to automate toggling read-only mode independently of partiton letter or disk 'rank'. | ||
A small script to automate toggling read-only mode independently of partiton letter or drive 'rank'. | ||
|
||
![Example with output enabled](read-only-enabled.png) | ||
## Getting Started | ||
|
||
```cd``` to your removable drive | ||
``` | ||
PS X:> cd X | ||
``` | ||
```git clone``` this repository | ||
|
||
``` | ||
PS X:> git clone https://github.com/Yiidiir/removable-read-only.git | ||
``` | ||
|
||
```cd``` to removable-read-only/examples | ||
|
||
``` | ||
PS X:> cd removable-read-only/examples | ||
``` | ||
|
||
|
||
|
||
## Usage | ||
**PowerShell must have elevated privileges (Administrator)** *to access Set-disk -IsReadOnly* | ||
|
||
``` | ||
PS X:> .\read_only.ps1 | ||
usage: .\read_only.ps1 [-write] (BOOLEAN) | ||
``` | ||
Set removable drive to read-only mode | ||
``` | ||
required argument: | ||
-write Allow writing in drive (must be explicitly declared) | ||
``` | ||
|
||
### Input | ||
|
||
The only existing input is a boolean declaring whenever writing should be allowed or not: | ||
|
||
``` | ||
PS X:> .\read_only.ps1 -write 0 | ||
``` | ||
|
||
|
||
### Output | ||
|
||
By default there will be no output. | ||
|
||
``` | ||
PS X:\> | ||
``` | ||
|
||
If you want to see a an output message, uncomment lines: 8,12,3 from ```read_only.ps1``` | ||
|
||
``` | ||
********************************************************** | ||
Read-Only Enabled: True | ||
********************************************************** | ||
PS F:\> | ||
``` | ||
### TODO: | ||
* Auto-exit console | ||
* Add Help parameter | ||
* Add Output parameter | ||
* Support Linux | ||
* Self-elevating permission in PowerShell | ||
|
||
|
||
Licensed under the [MIT License](https://github.com/Yiidiir/removable-read-only/blob/master/LICENSE) |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.