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 .NOTES Author: Markus Fleschutz / License: CC0
#> #>
param([string]$File) param([string]$File = "")
try { try {
if ($File -eq "" ) { if ($File -eq "" ) {

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -6,7 +6,7 @@
.NOTES Author: Markus Fleschutz / License: CC0 .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) function gap() { param([int]$Length)
for ([int]$i = 1; $i -lt $Length; $i++) { for ([int]$i = 1; $i -lt $Length; $i++) {

View File

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

View File

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