update readme with POSH info
This commit is contained in:
parent
6b9ca6a38c
commit
2b5f2f04f0
34
README.md
34
README.md
@ -4,17 +4,17 @@ Basic scripts to generate SRI hashes. POSIX-compliant shell script for use on *n
|
||||
|
||||
## common features
|
||||
|
||||
- Hash individual files or a quoted space-delimited list of files.
|
||||
- Hash individual files or a list of files.
|
||||
- Hash all files within a specified directory with one command.
|
||||
- Hash a filtered-list of files within a directory with one command.
|
||||
- Process a list of files and a directory (filtered or not) at the same time, saving you typing!
|
||||
|
||||
## linux script
|
||||
## Linux script
|
||||
|
||||
- This script *requires* openssl be installed and will exit if it cannot find openssl.
|
||||
- You can rename *sri* to anything you like.
|
||||
- I suggest copying *sri* somewhere like */usr/local/bin* or */usr/bin* so it can be run easier and from anywhere (see note below).
|
||||
- Complete help is included in the script. Simply run without any parameters or run with '*--help*'.
|
||||
- Complete instructions are included in the script. Simply run without any parameters or run with '*--help*'.
|
||||
|
||||
```bash
|
||||
./sri --help
|
||||
@ -60,3 +60,31 @@ ls -lA /path/to/sri
|
||||
# -rwxr-xr-x 1 user user 3622 Jun 20 01:18 sri
|
||||
# note the x's --> -rwXr-Xr-X (capitals for emphasis)
|
||||
```
|
||||
|
||||
## PowerShell (POSH) script
|
||||
|
||||
- You can rename this script to anything you want.
|
||||
- I suggest copying this script to a simple path since you must execute POSH scripts using their full path.
|
||||
- Complete instructions are included in the script. Run `Get-Help` as you would with any other POSH script.
|
||||
|
||||
```powershell
|
||||
Get-Help .\sri.ps1 # basic help including syntax
|
||||
Get-Help .\sri.ps1 -examples # detailed examples of script usage
|
||||
Get-Help .\sri.ps1 -detailed # full help document
|
||||
```
|
||||
|
||||
### execution policy
|
||||
|
||||
By default, Windows does not permit running any POSH scripts. You can change this behaviour by opening PowerShell as an administrator and entering the following command:
|
||||
|
||||
```powershell
|
||||
Set-ExecutionPolicy RemoteSigned
|
||||
```
|
||||
|
||||
This will allow scripts created on your machine to run as well an as *signed* scripts created on other machines. My script is signed, so it should run without any problems. This setting is far safer than bypassing the execution policy.
|
||||
|
||||
You can search for alternate bypass methods, but I have not included them here since switching to *RemoteSigned* is the technically correct approach.
|
||||
|
||||
## final thoughts
|
||||
|
||||
I hope these scripts help you out! If you have any comments, suggestions or improvements, please file an issue. I love getting feedback and learning new ways of doing things. For more scripts like this or solutions to common computing annoyances, check out my blog at [MyTechieThoughts.com](https://mytechiethoughts.com).
|
Loading…
Reference in New Issue
Block a user