Updated the manuals

This commit is contained in:
Markus Fleschutz
2025-01-17 08:31:53 +01:00
parent efe4a2c6b4
commit 33ef92d879
635 changed files with 2375 additions and 1666 deletions

View File

@@ -2,14 +2,15 @@ The *get-sha1.ps1* Script
===========================
This PowerShell script calculates and prints the SHA1 checksum of the given file.
NOTE: SHA1 is no longer considered secure, use it for simple change validation only!
Parameters
----------
```powershell
/home/markus/Repos/PowerShell/scripts/get-sha1.ps1 [[-file] <String>] [<CommonParameters>]
/Repos/PowerShell/scripts/get-sha1.ps1 [[-path] <String>] [<CommonParameters>]
-file <String>
Specifies the path to the file
-path <String>
Specifies the local file path to the file
Required? false
Position? 1
@@ -25,7 +26,7 @@ Parameters
Example
-------
```powershell
PS> ./get-sha1 C:\MyFile.txt
PS> ./get-sha1.ps1 C:\MyFile.txt
SHA1 hash is 8105D424D350E308AED92BD9DDEB74A1B53C5D7C
```
@@ -43,13 +44,14 @@ Script Content
```powershell
<#
.SYNOPSIS
Prints the SHA1 checksum of a file
Prints the SHA1 hash of a file
.DESCRIPTION
This PowerShell script calculates and prints the SHA1 checksum of the given file.
.PARAMETER file
Specifies the path to the file
NOTE: SHA1 is no longer considered secure, use it for simple change validation only!
.PARAMETER path
Specifies the local file path to the file
.EXAMPLE
PS> ./get-sha1 C:\MyFile.txt
PS> ./get-sha1.ps1 C:\MyFile.txt
✅ SHA1 hash is 8105D424D350E308AED92BD9DDEB74A1B53C5D7C
.LINK
https://github.com/fleschutz/PowerShell
@@ -57,19 +59,20 @@ Script Content
Author: Markus Fleschutz | License: CC0
#>
param([string]$file = "")
param([string]$path = "")
try {
if ($file -eq "" ) { $file = Read-Host "Enter the filename" }
if ($path -eq "" ) { $path = Read-Host "Enter the file path" }
if (-not(Test-Path $path -pathType leaf)) { throw "Invalid file path given: $path" }
$Result = get-filehash $file -algorithm SHA1
$result = Get-FileHash -path $path -algorithm SHA1
"✅ SHA1 hash is $($Result.Hash)"
"✅ SHA1 hash is $($result.Hash)"
exit 0 # success
} catch {
"⚠️ Error in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])"
"⚠️ Error: $($Error[0])"
exit 1
}
```
*(generated by convert-ps2md.ps1 as of 11/20/2024 11:51:53)*
*(page generated by convert-ps2md.ps1 as of 01/17/2025 08:30:52)*