Skip to content

Commit f98c049

Browse files
author
Markus Fleschutz
committed
Simple renaming to camel case
1 parent 1df42cc commit f98c049

13 files changed

Lines changed: 40 additions & 40 deletions

Scripts/clean-repo.ps1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ try {
3030
"⏳ (3/4) Removing untracked files in repository..."
3131
& git -C "$RepoDir" clean -xfd -f # to delete all untracked files in the main repo
3232
if ($lastExitCode -ne "0") {
33-
"'git clean' failed with exit code $lastExitCode, retrying once..."
33+
Write-Warning "'git clean' failed with exit code $lastExitCode, retrying once..."
3434
& git -C "$RepoDir" clean -xfd -f
3535
if ($lastExitCode -ne "0") { throw "'git clean' failed with exit code $lastExitCode" }
3636
}

Scripts/close-program.ps1

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ try {
3333
foreach ($Process in $Processes) {
3434
$Process.CloseMainWindow() | Out-Null
3535
}
36-
start-sleep -milliseconds 100
36+
Start-Sleep -milliseconds 100
3737
stop-process -name $ProgramName -force -errorAction 'silentlycontinue'
3838
} else {
3939
$Processes = get-process -name $ProgramAliasName -errorAction 'silentlycontinue'
@@ -43,7 +43,7 @@ try {
4343
foreach ($Process in $Processes) {
4444
$_.CloseMainWindow() | Out-Null
4545
}
46-
start-sleep -milliseconds 100
46+
Start-Sleep -milliseconds 100
4747
stop-process -name $ProgramName -force -errorAction 'silentlycontinue'
4848
}
4949
if ($($Processes.Count) -eq 1) {

Scripts/display-time.ps1

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,12 +17,12 @@ param([int]$Seconds = 10)
1717

1818
try {
1919
for ([int]$i = 0; $i -lt $Seconds; $i++) {
20-
clear-host
21-
write-output ""
20+
Clear-Host
21+
Write-Output ""
2222
$CurrentTime = Get-Date -format "yyyy-MM-dd HH:mm:ss"
2323
./write-big $CurrentTime
24-
write-output ""
25-
start-sleep -s 1
24+
Write-Output ""
25+
Start-Sleep -seconds 1
2626
}
2727
exit 0 # success
2828
} catch {

Scripts/enable-crash-dumps.ps1

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -97,9 +97,9 @@ $0x = "0x"
9797

9898
$array = @()
9999

100-
Clear-host
101-
write-host "Setting up your machine to receive Usermode Dumps via WER."
102-
Start-sleep -s 3
100+
Clear-Host
101+
Write-Host "Setting up your machine to receive Usermode Dumps via WER."
102+
Start-Sleep -seconds 3
103103

104104

105105
New-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows\Windows Error Reporting\LocalDumps" -Name "DumpFolder" -Value "%LOCALAPPDATA%\CrashDumps" -PropertyType ExpandString -Force
@@ -225,12 +225,12 @@ If ($NCD -eq '3')
225225
ElseIf($Option -eq 'q')
226226
{
227227
write-host "Closing application."
228-
Start-Sleep -s 2
228+
Start-Sleep -seconds 2
229229
}
230230
Else
231231
{
232232
write-host "Invalid Option, Try again."
233-
Start-sleep -s 2
233+
Start-Sleep -seconds 2
234234
}
235235

236236
}
@@ -291,7 +291,7 @@ ElseIf ($NCD -eq '2')
291291
}
292292
Else
293293
{
294-
write-host "You did not enter a valid option. Please re-run Get-Dump.ps1"
295-
start-sleep -s 5
294+
Write-Host "You did not enter a valid option. Please re-run Get-Dump.ps1"
295+
Start-Sleep -seconds 5
296296
}
297297
exit 0 # success

Scripts/install-basic-apps.ps1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ try {
2525
}
2626
""
2727
"Press <Control> <C> to abort, otherwise the installation will start in 10 seconds..."
28-
sleep -s 10
28+
Start-Sleep -seconds 10
2929

3030
[int]$Step = 2
3131
[int]$Failed = 0

Scripts/play-beep-sound.ps1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,5 +12,5 @@
1212
#>
1313

1414
[System.Console]::Beep(500,300)
15-
start-sleep -m 300
15+
Start-Sleep -milliseconds 300
1616
exit 0 # success

Scripts/play-mp3.ps1

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -16,14 +16,14 @@
1616
param([string]$Path = "")
1717

1818
try {
19-
if ($Path -eq "" ) { $Path = read-host "Enter the path to the MP3 sound file" }
19+
if ($Path -eq "" ) { $Path = Read-Host "Enter the path to the MP3 sound file" }
2020

21-
if (-not(test-path "$Path" -pathType leaf)) { throw "Can't access sound file: $Path" }
22-
$FullPath = (get-childItem $Path).fullname
23-
$Filename = (get-item "$FullPath").name
21+
if (-not(Test-Path "$Path" -pathType leaf)) { throw "Can't access sound file: $Path" }
22+
$FullPath = (Get-ChildItem $Path).fullname
23+
$Filename = (Get-Item "$FullPath").name
2424

25-
add-type -assemblyName PresentationCore
26-
$MediaPlayer = new-object System.Windows.Media.MediaPlayer
25+
Add-Type -assemblyName PresentationCore
26+
$MediaPlayer = New-Object System.Windows.Media.MediaPlayer
2727

2828
do {
2929
$MediaPlayer.open($FullPath)
@@ -37,7 +37,7 @@ try {
3737
$host.ui.RawUI.WindowTitle = "▶️ $Filename"
3838
$MediaPlayer.Volume = 1
3939
$MediaPlayer.play()
40-
start-sleep -milliseconds $Milliseconds
40+
Start-Sleep -milliseconds $Milliseconds
4141
$MediaPlayer.stop()
4242
$MediaPlayer.close()
4343
$host.ui.RawUI.WindowTitle = $PreviousTitle

Scripts/play-tetris-melody.ps1

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232
[System.Console]::Beep(1056,500)
3333
[System.Console]::Beep(880,500)
3434
[System.Console]::Beep(880,500)
35-
start-sleep -milliseconds 250
35+
Start-Sleep -milliseconds 250
3636
[System.Console]::Beep(1188,500)
3737
[System.Console]::Beep(1408,250)
3838
[System.Console]::Beep(1760,500)
@@ -51,7 +51,7 @@ start-sleep -milliseconds 250
5151
[System.Console]::Beep(1056,500)
5252
[System.Console]::Beep(880,500)
5353
[System.Console]::Beep(880,500)
54-
start-sleep -milliseconds 500
54+
Start-Sleep -milliseconds 500
5555
[System.Console]::Beep(1320,500)
5656
[System.Console]::Beep(990,250)
5757
[System.Console]::Beep(1056,250)
@@ -73,7 +73,7 @@ start-sleep -milliseconds 500
7373
[System.Console]::Beep(1056,500)
7474
[System.Console]::Beep(880,500)
7575
[System.Console]::Beep(880,500)
76-
start-sleep -milliseconds 250
76+
Start-Sleep -milliseconds 250
7777
[System.Console]::Beep(1188,500)
7878
[System.Console]::Beep(1408,250)
7979
[System.Console]::Beep(1760,500)
@@ -92,7 +92,7 @@ start-sleep -milliseconds 250
9292
[System.Console]::Beep(1056,500)
9393
[System.Console]::Beep(880,500)
9494
[System.Console]::Beep(880,500)
95-
start-sleep -milliseconds 500
95+
Start-Sleep -milliseconds 500
9696
[System.Console]::Beep(660,1000)
9797
[System.Console]::Beep(528,1000)
9898
[System.Console]::Beep(594,1000)

Scripts/set-timer.ps1

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,9 @@ try {
1919
if ($Seconds -eq 0 ) { [int]$Seconds = read-host "Enter number of seconds" }
2020

2121
for ($i = $Seconds; $i -gt 0; $i--) {
22-
clear-host
22+
Clear-Host
2323
./write-big "T-$i seconds"
24-
start-sleep -s 1
24+
Start-Sleep -seconds 1
2525
}
2626

2727
"✔️ $Seconds seconds countdown finished"

Scripts/simulate-presence.ps1

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
<#
22
.SYNOPSIS
3-
Simulates the human presence against burglars
3+
Simulate a human against burglars
44
.DESCRIPTION
5-
This PowerShell script simulates the human presence against burglars.
5+
This PowerShell script simulates the human presence against burglars. It switches a Shelly1 device on and off.
66
.PARAMETER IPaddress
77
Specifies the IP address of the Shelly1 device
88
.EXAMPLE
@@ -16,16 +16,15 @@
1616
param([string]$IPaddress = "")
1717

1818
try {
19-
if ($IPaddress -eq "" ) { $IPaddress = read-host "Enter IP address of Shelly1 device" }
19+
if ($IPaddress -eq "" ) { $IPaddress = Read-Host "Enter IP address of the Shelly1 device" }
2020

2121
for ([int]$i = 0; $i -lt 1000; $i++) {
2222
& "$PSScriptRoot/switch-shelly1.ps1" $IPaddress on 0
23-
start-sleep -s 10
23+
Start-Sleep -seconds 10 # on for 10 seconds
2424
& "$PSScriptRoot/switch-shelly1.ps1" $IPaddress off 0
25-
start-sleep -s 60
25+
Start-Sleep -seconds 60 # off for 60 seconds
2626
}
27-
28-
"✔️ Done."
27+
"✔️ Done."
2928
exit 0 # success
3029
} catch {
3130
"⚠️ Error in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])"

0 commit comments

Comments
 (0)