Updated the scripts

This commit is contained in:
Markus Fleschutz 2021-01-02 10:08:59 +00:00
parent 40aad7fe73
commit 92b6c81620
29 changed files with 38 additions and 32 deletions

View File

@ -6,7 +6,7 @@
.NOTES Author: Markus Fleschutz / License: CC0
#>
param([string]$File)
param([string]$File = "")
try {
if ($File -eq "" ) {

View File

@ -6,7 +6,7 @@
.NOTES Author: Markus Fleschutz / License: CC0
#>
param([string]$File)
param([string]$File = "")
try {
if ($File -eq "" ) {

View File

@ -6,7 +6,7 @@
.NOTES Author: Markus Fleschutz / License: CC0
#>
param([string]$File)
param([string]$File = "")
try {
if ($File -eq "" ) {

View File

@ -19,7 +19,7 @@ $QuietZone = 1
$ForegroundColor = "000000"
$BackgroundColor = "ffffff"
$FileFormat = "jpg"
$PathToRepo=(get-item $MyInvocation.MyCommand.Path).directory.parent
$PathToRepo = "$PSScriptRoot/.."
$NewFile = "$PathToRepo/Data/qrcode.jpg"
try {

View File

@ -6,9 +6,10 @@
.NOTES Author: Markus Fleschutz / License: CC0
#>
$PathToRepo = "$PSScriptRoot/.."
try {
write-progress "Reading Data/logbook.csv..."
$PathToRepo=(get-item $MyInvocation.MyCommand.Path).directory.parent
$Table = import-csv "$PathToRepo/Data/logbook.csv"
write-output ""

View File

@ -6,9 +6,10 @@
.NOTES Author: Markus Fleschutz / License: CC0
#>
$PathToRepo = "$PSScriptRoot/.."
try {
write-progress "Reading OS_IPFS_hashes.csv"
$PathToRepo = "$PSScriptRoot/.."
$PathToCsvFile = "$PathToRepo/Data/os-release.csv"
invoke-webRequest -URI "https://fleschutz.droppages.com/downloads/OS_IPFS_hashes.csv" -outFile "$PathToCsvFile"
$Table = import-csv "$PathToCsvFile"

View File

@ -6,9 +6,10 @@
.NOTES Author: Markus Fleschutz / License: CC0
#>
$PathToRepo = "$PSScriptRoot/.."
try {
write-progress "Reading Data/scripts.csv..."
$PathToRepo = (get-item $MyInvocation.MyCommand.Path).directory.parent
$Table = import-csv "$PathToRepo/Data/scripts.csv"
write-output ""

View File

@ -10,10 +10,10 @@ param([string]$City)
if ($City -eq "" ) {
$City = read-host "Enter the city"
}
$PathToRepo = "$PSScriptRoot/.."
try {
write-progress "Reading worldcities.csv..."
$PathToRepo=(get-item $MyInvocation.MyCommand.Path).directory.parent
$Table = import-csv "$PathToRepo/Data/worldcities.csv"
$FoundOne = 0

View File

@ -6,7 +6,8 @@
.NOTES Author: Markus Fleschutz / License: CC0
#>
param([string]$CountryCode, [string]$ZipCode)
param([string]$CountryCode = "", [string]$ZipCode = "")
$PathToRepo = "$PSScriptRoot/.."
try {
if ($CountryCode -eq "" ) {
@ -17,7 +18,6 @@ try {
}
write-progress "Reading zip-codes.csv..."
$PathToRepo=(get-item $MyInvocation.MyCommand.Path).directory.parent
$Table = import-csv "$PathToRepo/Data/zip-codes.csv"
$FoundOne = 0

View File

@ -6,7 +6,7 @@
.NOTES Author: Markus Fleschutz / License: CC0
#>
param([string]$EmailAddress)
param([string]$EmailAddress = "")
try {
if ($EmailAddress -eq "" ) {

View File

@ -6,7 +6,7 @@
.NOTES Author: Markus Fleschutz / License: CC0
#>
param([string]$URL)
param([string]$URL = "")
try {
if ($URL -eq "" ) {

View File

@ -6,7 +6,7 @@
.NOTES Author: Markus Fleschutz / License: CC0
#>
param([string]$Pattern, [string]$Path)
param([string]$Pattern = "", [string]$Path = "")
Set-StrictMode -Version Latest

View File

@ -6,7 +6,7 @@
.NOTES Author: Markus Fleschutz / License: CC0
#>
param([string]$TargetIP, [int]$TargetPort, [string]$Message)
param([string]$TargetIP = "", [int]$TargetPort = 0, [string]$Message = "")
try {
if ($TargetIP -eq "" ) {

View File

@ -6,7 +6,7 @@
.NOTES Author: Markus Fleschutz / License: CC0
#>
param([string]$TargetIP, [int]$TargetPort, [string]$Message)
param([string]$TargetIP = "", [int]$TargetPort = 0, [string]$Message = "")
try {
if ($TargetIP -eq "" ) {

View File

@ -6,7 +6,8 @@
.NOTES Author: Markus Fleschutz / License: CC0
#>
param([int]$Seconds)
param([int]$Seconds = 0)
try {
if ($Seconds -eq 0 ) {
[int]$Seconds = read-host "Enter number of seconds"

View File

@ -6,9 +6,10 @@
.NOTES Author: Markus Fleschutz / License: CC0
#>
$PathToRepo = "$PSScriptRoot/.."
try {
write-progress "Reading Data/matrix.csv..."
$PathToRepo=(get-item $MyInvocation.MyCommand.Path).directory.parent
$Table = import-csv "$PathToRepo/Data/matrix.csv"
clear-host

View File

@ -6,7 +6,7 @@
.NOTES Author: Markus Fleschutz / License: CC0
#>
param([string]$File)
param([string]$File = "")
try {
if ($File -eq "") {

View File

@ -6,7 +6,7 @@
.NOTES Author: Markus Fleschutz / License: CC0
#>
param([string]$Text)
param([string]$Text = "")
try {
if ($Text -eq "") {

View File

@ -6,7 +6,7 @@
.NOTES Author: Markus Fleschutz / License: CC0
#>
param([string]$IPaddr, [string]$TurnMode, [int]$Timer = -999)
param([string]$IPaddr = "", [string]$TurnMode = "", [int]$Timer = -999)
try {
if ($IPaddr -eq "") {

View File

@ -7,12 +7,13 @@
#>
Set-StrictMode -Version Latest
$PathToRepo = "$PSScriptRoot/.."
try {
$StartTime = Get-Date
write-progress "Reading Data/domain-names.csv..."
$PathToRepo=(get-item $MyInvocation.MyCommand.Path).directory.parent
$Table = import-csv "$PathToRepo/Data/domain-names.csv"
foreach($Row in $Table) {

View File

@ -6,7 +6,9 @@
.NOTES Author: Markus Fleschutz / License: CC0
#>
param([string]$SourceFile, [string]$SourceLanguage, [string]$TargetLanguage)
param([string]$SourceFile = "", [string]$SourceLanguage = "", [string]$TargetLanguage = "")
$PathToRepo = "$PSScriptRoot/.."
try {
if ($SourceFile -eq "" ) {
@ -19,8 +21,6 @@ try {
$TargetLanguage = read-host "Enter language to translate to"
}
$PathToRepo=(get-item $MyInvocation.MyCommand.Path).directory.parent
Start-Process -FilePath "$PathToRepo/Data/trans" -ArgumentList "-i $SourceFile -s $SourceLanguage -t $TargetLanguage -e google -brief" -NoNewWindow -Wait
exit 0
} catch {

View File

@ -6,7 +6,7 @@
.NOTES Author: Markus Fleschutz / License: CC0
#>
param([string]$SourceText, [string]$SourceLang = "en")
param([string]$SourceText = "", [string]$SourceLang = "en")
if ($SourceText -eq "" ) {
$SourceText = read-host "Enter text to translate"

View File

@ -6,7 +6,7 @@
.NOTES Author: Markus Fleschutz / License: CC0
#>
param([string]$Hostname)
param([string]$Hostname = "")
if ($Hostname -eq "" ) {
$Hostname = read-host "Enter hostname"
}

View File

@ -6,7 +6,7 @@
.NOTES Author: Markus Fleschutz / License: CC0
#>
param([string]$Text)
param([string]$Text = "")
Set-StrictMode -Version Latest

View File

@ -6,7 +6,7 @@
.NOTES Author: Markus Fleschutz / License: CC0
#>
param([string]$Text)
param([string]$Text = "")
try {
if ($Text -eq "" ) {

View File

@ -6,7 +6,7 @@
.NOTES Author: Markus Fleschutz / License: CC0
#>
param([string]$Text)
param([string]$Text = "")
function BrailleA() { param([int]$Row)
switch($Row) {

View File

@ -6,7 +6,7 @@
.NOTES Author: Markus Fleschutz / License: CC0
#>
param([string]$Text, [int]$OneTimeUnit = 100) # in milliseconds
param([string]$Text = "", [int]$OneTimeUnit = 100) # in milliseconds
function gap() { param([int]$Length)
for ([int]$i = 1; $i -lt $Length; $i++) {

View File

@ -6,7 +6,7 @@
.NOTES Author: Markus Fleschutz / License: CC0
#>
param([string]$Text)
param([string]$Text = "")
function ROT13 { param([string]$Text)
$Text.ToCharArray() | ForEach-Object {

View File

@ -6,7 +6,7 @@
.NOTES Author: Markus Fleschutz / License: CC0
#>
param([string]$Path)
param([string]$Path = "")
try {
if ($Path -eq "" ) {