From f0bc1b4160b0d78bb19e881b9eeda3e09cbd5c5e Mon Sep 17 00:00:00 2001 From: Markus Fleschutz Date: Sat, 11 Sep 2021 11:37:22 +0200 Subject: [PATCH] Update the manuals --- Docs/check-file-system.ps1.md | 30 ++++++++++++++++++- Docs/check-windows-system-files.ps1.md | 20 ++++++++++++- Docs/hibernate.ps1.md | 20 ++++++++++++- Docs/install-ssh-client.ps1.md | 20 ++++++++++++- Docs/install-ssh-server.ps1.md | 20 ++++++++++++- Docs/install-wsl.ps1.md | 20 ++++++++++++- Docs/list-fritzbox-calls.ps1.md | 40 +++++++++++++++++++++++++- Docs/list-fritzbox-devices.ps1.md | 40 +++++++++++++++++++++++++- Docs/list-print-jobs.ps1.md | 20 ++++++++++++- Docs/list-voices.ps1.md | 3 -- Docs/poweroff.ps1.md | 20 ++++++++++++- Docs/query-smart-data.ps1.md | 33 ++++++++++++++++++++- Docs/reboot.ps1.md | 20 ++++++++++++- Docs/remove-print-jobs.ps1.md | 20 ++++++++++++- Docs/restart-network-adapters.ps1.md | 20 ++++++++++++- Scripts/check-file-system.ps1 | 5 ++-- Scripts/check-windows-system-files.ps1 | 5 ++-- Scripts/hibernate.ps1 | 5 ++-- Scripts/install-ssh-client.ps1 | 5 ++-- Scripts/install-ssh-server.ps1 | 5 ++-- Scripts/install-wsl.ps1 | 5 ++-- Scripts/list-fritzbox-calls.ps1 | 5 ++-- Scripts/list-fritzbox-devices.ps1 | 5 ++-- Scripts/list-print-jobs.ps1 | 5 ++-- Scripts/list-voices.ps1 | 2 +- Scripts/poweroff.ps1 | 5 ++-- Scripts/query-smart-data.ps1 | 5 ++-- Scripts/reboot.ps1 | 5 ++-- Scripts/remove-print-jobs.ps1 | 5 ++-- Scripts/restart-network-adapters.ps1 | 5 ++-- 30 files changed, 372 insertions(+), 46 deletions(-) diff --git a/Docs/check-file-system.ps1.md b/Docs/check-file-system.ps1.md index 9a918ed6..16c2b8a8 100644 --- a/Docs/check-file-system.ps1.md +++ b/Docs/check-file-system.ps1.md @@ -2,8 +2,24 @@ ## Synopsis & Description ```powershell -check-file-system.ps1 [[-Drive] ] +check-file-system.ps1 [] +``` +Checks the file system of a drive (needs admin rights) + +## Syntax & Parameters +```powershell +/home/mf/PowerShell/Scripts/check-file-system.ps1 [[-Drive] ] [] +``` + +``` +-Drive + + Required? false + Position? 1 + Default value + Accept pipeline input? false + Accept wildcard characters? false ``` ``` @@ -12,4 +28,16 @@ check-file-system.ps1 [[-Drive] ] WarningVariable, OutBuffer, PipelineVariable, and OutVariable. ``` +## Example +```powershell +PS>.\check-file-system.ps1 C +``` + + +## Notes +Author: Markus Fleschutz · License: CC0 + +## Related Links +https://github.com/fleschutz/PowerShell + *Generated by convert-ps2md.ps1 using the comment-based help of check-file-system.ps1* diff --git a/Docs/check-windows-system-files.ps1.md b/Docs/check-windows-system-files.ps1.md index d383f4bc..e481e34c 100644 --- a/Docs/check-windows-system-files.ps1.md +++ b/Docs/check-windows-system-files.ps1.md @@ -2,8 +2,14 @@ ## Synopsis & Description ```powershell -check-windows-system-files.ps1 +check-windows-system-files.ps1 +``` +Checks the validity of the Windows system files (requires admin rights). + +## Syntax & Parameters +```powershell +/home/mf/PowerShell/Scripts/check-windows-system-files.ps1 [] ``` ``` @@ -12,4 +18,16 @@ check-windows-system-files.ps1 WarningVariable, OutBuffer, PipelineVariable, and OutVariable. ``` +## Example +```powershell +PS>.\check-windows-system-files.ps1 +``` + + +## Notes +Author: Markus Fleschutz · License: CC0 + +## Related Links +https://github.com/fleschutz/PowerShell + *Generated by convert-ps2md.ps1 using the comment-based help of check-windows-system-files.ps1* diff --git a/Docs/hibernate.ps1.md b/Docs/hibernate.ps1.md index 1d4e35ac..2eb49e8f 100644 --- a/Docs/hibernate.ps1.md +++ b/Docs/hibernate.ps1.md @@ -2,8 +2,14 @@ ## Synopsis & Description ```powershell -hibernate.ps1 +hibernate.ps1 +``` +Enables hibernate mode for the local computer (needs admin rights). + +## Syntax & Parameters +```powershell +/home/mf/PowerShell/Scripts/hibernate.ps1 [] ``` ``` @@ -12,4 +18,16 @@ hibernate.ps1 WarningVariable, OutBuffer, PipelineVariable, and OutVariable. ``` +## Example +```powershell +PS>.\hibernate.ps1 +``` + + +## Notes +Author: Markus Fleschutz · License: CC0 + +## Related Links +https://github.com/fleschutz/PowerShell + *Generated by convert-ps2md.ps1 using the comment-based help of hibernate.ps1* diff --git a/Docs/install-ssh-client.ps1.md b/Docs/install-ssh-client.ps1.md index 6754880a..783132fd 100644 --- a/Docs/install-ssh-client.ps1.md +++ b/Docs/install-ssh-client.ps1.md @@ -2,8 +2,14 @@ ## Synopsis & Description ```powershell -install-ssh-client.ps1 +install-ssh-client.ps1 +``` +Installs the SSH client (needs admin rights). + +## Syntax & Parameters +```powershell +/home/mf/PowerShell/Scripts/install-ssh-client.ps1 [] ``` ``` @@ -12,4 +18,16 @@ install-ssh-client.ps1 WarningVariable, OutBuffer, PipelineVariable, and OutVariable. ``` +## Example +```powershell +PS>.\install-ssh-client.ps1 +``` + + +## Notes +Author: Markus Fleschutz · License: CC0 + +## Related Links +https://github.com/fleschutz/PowerShell + *Generated by convert-ps2md.ps1 using the comment-based help of install-ssh-client.ps1* diff --git a/Docs/install-ssh-server.ps1.md b/Docs/install-ssh-server.ps1.md index af91c836..b46c314a 100644 --- a/Docs/install-ssh-server.ps1.md +++ b/Docs/install-ssh-server.ps1.md @@ -2,8 +2,14 @@ ## Synopsis & Description ```powershell -install-ssh-server.ps1 +install-ssh-server.ps1 +``` +Installs the SSH server (needs admin rights). + +## Syntax & Parameters +```powershell +/home/mf/PowerShell/Scripts/install-ssh-server.ps1 [] ``` ``` @@ -12,4 +18,16 @@ install-ssh-server.ps1 WarningVariable, OutBuffer, PipelineVariable, and OutVariable. ``` +## Example +```powershell +PS>.\install-ssh-server.ps1 +``` + + +## Notes +Author: Markus Fleschutz · License: CC0 + +## Related Links +https://github.com/fleschutz/PowerShell + *Generated by convert-ps2md.ps1 using the comment-based help of install-ssh-server.ps1* diff --git a/Docs/install-wsl.ps1.md b/Docs/install-wsl.ps1.md index 56c9f2d1..58903e87 100644 --- a/Docs/install-wsl.ps1.md +++ b/Docs/install-wsl.ps1.md @@ -2,8 +2,14 @@ ## Synopsis & Description ```powershell -install-wsl.ps1 +install-wsl.ps1 +``` +Installs Windows Subsystem for Linux (WSL) - needs admin rights. + +## Syntax & Parameters +```powershell +/home/mf/PowerShell/Scripts/install-wsl.ps1 [] ``` ``` @@ -12,4 +18,16 @@ install-wsl.ps1 WarningVariable, OutBuffer, PipelineVariable, and OutVariable. ``` +## Example +```powershell +PS>.\install-wsl.ps1 +``` + + +## Notes +Author: Markus Fleschutz · License: CC0 + +## Related Links +https://github.com/fleschutz/PowerShell + *Generated by convert-ps2md.ps1 using the comment-based help of install-wsl.ps1* diff --git a/Docs/list-fritzbox-calls.ps1.md b/Docs/list-fritzbox-calls.ps1.md index 0ceafa37..726566b4 100644 --- a/Docs/list-fritzbox-calls.ps1.md +++ b/Docs/list-fritzbox-calls.ps1.md @@ -2,8 +2,34 @@ ## Synopsis & Description ```powershell -list-fritzbox-calls.ps1 [[-Username] ] [[-Password] ] +list-fritzbox-calls.ps1 [] [] +``` +Lists the phone calls of the FRITZ!Box device. + +## Syntax & Parameters +```powershell +/home/mf/PowerShell/Scripts/list-fritzbox-calls.ps1 [[-Username] ] [[-Password] ] [] +``` + +``` +-Username + + Required? false + Position? 1 + Default value + Accept pipeline input? false + Accept wildcard characters? false +``` + +``` +-Password + + Required? false + Position? 2 + Default value + Accept pipeline input? false + Accept wildcard characters? false ``` ``` @@ -12,4 +38,16 @@ list-fritzbox-calls.ps1 [[-Username] ] [[-Password] ] WarningVariable, OutBuffer, PipelineVariable, and OutVariable. ``` +## Example +```powershell +PS>.\list-fritzbox-calls.ps1 +``` + + +## Notes +Author: Markus Fleschutz · License: CC0 + +## Related Links +https://github.com/fleschutz/PowerShell + *Generated by convert-ps2md.ps1 using the comment-based help of list-fritzbox-calls.ps1* diff --git a/Docs/list-fritzbox-devices.ps1.md b/Docs/list-fritzbox-devices.ps1.md index 89d856e2..a7ad27e3 100644 --- a/Docs/list-fritzbox-devices.ps1.md +++ b/Docs/list-fritzbox-devices.ps1.md @@ -2,8 +2,34 @@ ## Synopsis & Description ```powershell -list-fritzbox-devices.ps1 [[-Username] ] [[-Password] ] +list-fritzbox-devices.ps1 [] [] +``` +Lists FRITZ!Box's known devices. + +## Syntax & Parameters +```powershell +/home/mf/PowerShell/Scripts/list-fritzbox-devices.ps1 [[-Username] ] [[-Password] ] [] +``` + +``` +-Username + + Required? false + Position? 1 + Default value + Accept pipeline input? false + Accept wildcard characters? false +``` + +``` +-Password + + Required? false + Position? 2 + Default value + Accept pipeline input? false + Accept wildcard characters? false ``` ``` @@ -12,4 +38,16 @@ list-fritzbox-devices.ps1 [[-Username] ] [[-Password] ] WarningVariable, OutBuffer, PipelineVariable, and OutVariable. ``` +## Example +```powershell +PS>.\list-fritzbox-devices.ps1 +``` + + +## Notes +Author: Markus Fleschutz · License: CC0 + +## Related Links +https://github.com/fleschutz/PowerShell + *Generated by convert-ps2md.ps1 using the comment-based help of list-fritzbox-devices.ps1* diff --git a/Docs/list-print-jobs.ps1.md b/Docs/list-print-jobs.ps1.md index a7fd1067..0828065a 100644 --- a/Docs/list-print-jobs.ps1.md +++ b/Docs/list-print-jobs.ps1.md @@ -2,8 +2,14 @@ ## Synopsis & Description ```powershell -list-print-jobs.ps1 +list-print-jobs.ps1 +``` +Lists all jobs from all printers + +## Syntax & Parameters +```powershell +/home/mf/PowerShell/Scripts/list-print-jobs.ps1 [] ``` ``` @@ -12,4 +18,16 @@ list-print-jobs.ps1 WarningVariable, OutBuffer, PipelineVariable, and OutVariable. ``` +## Example +```powershell +PS>.\list-print-jobs.ps1 +``` + + +## Notes +Author: Markus Fleschutz · License: CC0 + +## Related Links +https://github.com/fleschutz/PowerShell + *Generated by convert-ps2md.ps1 using the comment-based help of list-print-jobs.ps1* diff --git a/Docs/list-voices.ps1.md b/Docs/list-voices.ps1.md index dc715d19..a842a114 100644 --- a/Docs/list-voices.ps1.md +++ b/Docs/list-voices.ps1.md @@ -30,7 +30,4 @@ Author: Markus Fleschutz · License: CC0 ## Related Links https://github.com/fleschutz/PowerShell - -Requires -Version 2.0 - *Generated by convert-ps2md.ps1 using the comment-based help of list-voices.ps1* diff --git a/Docs/poweroff.ps1.md b/Docs/poweroff.ps1.md index 6c206cf2..d808867f 100644 --- a/Docs/poweroff.ps1.md +++ b/Docs/poweroff.ps1.md @@ -2,8 +2,14 @@ ## Synopsis & Description ```powershell -poweroff.ps1 +poweroff.ps1 +``` +Halts the local computer (needs admin rights). + +## Syntax & Parameters +```powershell +/home/mf/PowerShell/Scripts/poweroff.ps1 [] ``` ``` @@ -12,4 +18,16 @@ poweroff.ps1 WarningVariable, OutBuffer, PipelineVariable, and OutVariable. ``` +## Example +```powershell +PS>.\poweroff.ps1 +``` + + +## Notes +Author: Markus Fleschutz · License: CC0 + +## Related Links +https://github.com/fleschutz/PowerShell + *Generated by convert-ps2md.ps1 using the comment-based help of poweroff.ps1* diff --git a/Docs/query-smart-data.ps1.md b/Docs/query-smart-data.ps1.md index 1b7d8327..d7164133 100644 --- a/Docs/query-smart-data.ps1.md +++ b/Docs/query-smart-data.ps1.md @@ -2,8 +2,27 @@ ## Synopsis & Description ```powershell -query-smart-data.ps1 [[-Directory] ] +query-smart-data.ps1 [] +``` +Queries the S.M.A.R.T. data of your HDD/SSD's and saves it to the current/given directory +(use smart-data2csv.ps1 to generate a CSV table for analysis). + + Requires smartctl (smartmontools) and admin rights. For automation copy this script to /etc/cron.daily + +## Syntax & Parameters +```powershell +/home/mf/PowerShell/Scripts/query-smart-data.ps1 [[-Directory] ] [] +``` + +``` +-Directory + + Required? false + Position? 1 + Default value + Accept pipeline input? false + Accept wildcard characters? false ``` ``` @@ -12,4 +31,16 @@ query-smart-data.ps1 [[-Directory] ] WarningVariable, OutBuffer, PipelineVariable, and OutVariable. ``` +## Example +```powershell +PS>.\query-smart-data.ps1 +``` + + +## Notes +Author: Markus Fleschutz · License: CC0 + +## Related Links +https://github.com/fleschutz/PowerShell + *Generated by convert-ps2md.ps1 using the comment-based help of query-smart-data.ps1* diff --git a/Docs/reboot.ps1.md b/Docs/reboot.ps1.md index 9edf941f..0f9b899a 100644 --- a/Docs/reboot.ps1.md +++ b/Docs/reboot.ps1.md @@ -2,8 +2,14 @@ ## Synopsis & Description ```powershell -reboot.ps1 +reboot.ps1 +``` +Reboots the local computer (needs admin rights). + +## Syntax & Parameters +```powershell +/home/mf/PowerShell/Scripts/reboot.ps1 [] ``` ``` @@ -12,4 +18,16 @@ reboot.ps1 WarningVariable, OutBuffer, PipelineVariable, and OutVariable. ``` +## Example +```powershell +PS>.\reboot.ps1 +``` + + +## Notes +Author: Markus Fleschutz · License: CC0 + +## Related Links +https://github.com/fleschutz/PowerShell + *Generated by convert-ps2md.ps1 using the comment-based help of reboot.ps1* diff --git a/Docs/remove-print-jobs.ps1.md b/Docs/remove-print-jobs.ps1.md index 468d03c6..557bc0d6 100644 --- a/Docs/remove-print-jobs.ps1.md +++ b/Docs/remove-print-jobs.ps1.md @@ -2,8 +2,14 @@ ## Synopsis & Description ```powershell -remove-print-jobs.ps1 +remove-print-jobs.ps1 +``` +removes all jobs from all printers + +## Syntax & Parameters +```powershell +/home/mf/PowerShell/Scripts/remove-print-jobs.ps1 [] ``` ``` @@ -12,4 +18,16 @@ remove-print-jobs.ps1 WarningVariable, OutBuffer, PipelineVariable, and OutVariable. ``` +## Example +```powershell +PS>.\remove-print-jobs.ps1 +``` + + +## Notes +Author: Markus Fleschutz · License: CC0 + +## Related Links +https://github.com/fleschutz/PowerShell + *Generated by convert-ps2md.ps1 using the comment-based help of remove-print-jobs.ps1* diff --git a/Docs/restart-network-adapters.ps1.md b/Docs/restart-network-adapters.ps1.md index 86c5e988..5dfd3c6d 100644 --- a/Docs/restart-network-adapters.ps1.md +++ b/Docs/restart-network-adapters.ps1.md @@ -2,8 +2,14 @@ ## Synopsis & Description ```powershell -restart-network-adapters.ps1 +restart-network-adapters.ps1 +``` +Restarts all local network adapters (needs admin rights). + +## Syntax & Parameters +```powershell +/home/mf/PowerShell/Scripts/restart-network-adapters.ps1 [] ``` ``` @@ -12,4 +18,16 @@ restart-network-adapters.ps1 WarningVariable, OutBuffer, PipelineVariable, and OutVariable. ``` +## Example +```powershell +PS>.\restart-network-adapters.ps1 +``` + + +## Notes +Author: Markus Fleschutz · License: CC0 + +## Related Links +htts://github.com/fleschutz/PowerShell + *Generated by convert-ps2md.ps1 using the comment-based help of restart-network-adapters.ps1* diff --git a/Scripts/check-file-system.ps1 b/Scripts/check-file-system.ps1 index e0f09939..b673bc0b 100755 --- a/Scripts/check-file-system.ps1 +++ b/Scripts/check-file-system.ps1 @@ -1,5 +1,4 @@ -#Requires -RunAsAdministrator -<# +<# .SYNOPSIS check-file-system.ps1 [] .DESCRIPTION @@ -12,6 +11,8 @@ Author: Markus Fleschutz · License: CC0 #> +#Requires -RunAsAdministrator + param([string]$Drive = "") try { diff --git a/Scripts/check-windows-system-files.ps1 b/Scripts/check-windows-system-files.ps1 index c751bdca..04ce93a5 100755 --- a/Scripts/check-windows-system-files.ps1 +++ b/Scripts/check-windows-system-files.ps1 @@ -1,5 +1,4 @@ -#Requires -RunAsAdministrator -<# +<# .SYNOPSIS check-windows-system-files.ps1 .DESCRIPTION @@ -12,6 +11,8 @@ Author: Markus Fleschutz · License: CC0 #> +#Requires -RunAsAdministrator + try { sfc /verifyOnly if ($lastExitCode -ne "0") { throw "'sfc /verifyOnly' failed" } diff --git a/Scripts/hibernate.ps1 b/Scripts/hibernate.ps1 index 0f6e8c36..6e975993 100755 --- a/Scripts/hibernate.ps1 +++ b/Scripts/hibernate.ps1 @@ -1,5 +1,4 @@ -#Requires -RunAsAdministrator -<# +<# .SYNOPSIS hibernate.ps1 .DESCRIPTION @@ -12,6 +11,8 @@ https://github.com/fleschutz/PowerShell #> +#Requires -RunAsAdministrator + try { [Void][System.Reflection.Assembly]::LoadWithPartialName("System.Windows.Forms") [System.Windows.Forms.Application]::SetSuspendState("Hibernate", $false, $false); diff --git a/Scripts/install-ssh-client.ps1 b/Scripts/install-ssh-client.ps1 index 54020ffb..684a5d03 100755 --- a/Scripts/install-ssh-client.ps1 +++ b/Scripts/install-ssh-client.ps1 @@ -1,5 +1,4 @@ -#Requires -RunAsAdministrator -<# +<# .SYNOPSIS install-ssh-client.ps1 .DESCRIPTION @@ -12,6 +11,8 @@ https://github.com/fleschutz/PowerShell #> +#Requires -RunAsAdministrator + try { $StopWatch = [system.diagnostics.stopwatch]::startNew() diff --git a/Scripts/install-ssh-server.ps1 b/Scripts/install-ssh-server.ps1 index e6a1563b..e1f32f8d 100755 --- a/Scripts/install-ssh-server.ps1 +++ b/Scripts/install-ssh-server.ps1 @@ -1,5 +1,4 @@ -#Requires -RunAsAdministrator -<# +<# .SYNOPSIS install-ssh-server.ps1 .DESCRIPTION @@ -12,6 +11,8 @@ https://github.com/fleschutz/PowerShell #> +#Requires -RunAsAdministrator + try { $StopWatch = [system.diagnostics.stopwatch]::startNew() diff --git a/Scripts/install-wsl.ps1 b/Scripts/install-wsl.ps1 index 35238b9f..9cc28e38 100755 --- a/Scripts/install-wsl.ps1 +++ b/Scripts/install-wsl.ps1 @@ -1,5 +1,4 @@ -#Requires -RunAsAdministrator -<# +<# .SYNOPSIS install-wsl.ps1 .DESCRIPTION @@ -12,6 +11,8 @@ https://github.com/fleschutz/PowerShell #> +#Requires -RunAsAdministrator + try { $StopWatch = [system.diagnostics.stopwatch]::startNew() diff --git a/Scripts/list-fritzbox-calls.ps1 b/Scripts/list-fritzbox-calls.ps1 index 46a0cccf..8c3cfeaa 100755 --- a/Scripts/list-fritzbox-calls.ps1 +++ b/Scripts/list-fritzbox-calls.ps1 @@ -1,5 +1,4 @@ -#Requires -Version 3 -<# +<# .SYNOPSIS list-fritzbox-calls.ps1 [] [] .DESCRIPTION @@ -12,6 +11,8 @@ https://github.com/fleschutz/PowerShell #> +#Requires -Version 3 + param([string]$Username = "", [string]$Password = "") if ($Username -eq "") { $Username = read-host "Enter username for FRITZ!Box" } diff --git a/Scripts/list-fritzbox-devices.ps1 b/Scripts/list-fritzbox-devices.ps1 index f30a3395..f11590be 100755 --- a/Scripts/list-fritzbox-devices.ps1 +++ b/Scripts/list-fritzbox-devices.ps1 @@ -1,5 +1,4 @@ -#Requires -Version 3 -<# +<# .SYNOPSIS list-fritzbox-devices.ps1 [] [] .DESCRIPTION @@ -12,6 +11,8 @@ https://github.com/fleschutz/PowerShell #> +#Requires -Version 3 + param([string]$Username = "", [string]$Password = "") if ($Username -eq "") { $Username = read-host "Enter username for FRITZ!Box" } diff --git a/Scripts/list-print-jobs.ps1 b/Scripts/list-print-jobs.ps1 index c63995c3..630629f2 100755 --- a/Scripts/list-print-jobs.ps1 +++ b/Scripts/list-print-jobs.ps1 @@ -1,5 +1,4 @@ -#requires -version 4 -<# +<# .SYNOPSIS list-print-jobs.ps1 .DESCRIPTION @@ -12,6 +11,8 @@ https://github.com/fleschutz/PowerShell #> +#Requires -Version 4 + try { $printers = Get-Printer if ($printers.Count -eq 0) { throw "No printer found" } diff --git a/Scripts/list-voices.ps1 b/Scripts/list-voices.ps1 index c7269d3e..71d38311 100644 --- a/Scripts/list-voices.ps1 +++ b/Scripts/list-voices.ps1 @@ -10,7 +10,7 @@ .LINK https://github.com/fleschutz/PowerShell #> -# + #Requires -Version 2.0 try { diff --git a/Scripts/poweroff.ps1 b/Scripts/poweroff.ps1 index a01b51f8..8fd45e6c 100755 --- a/Scripts/poweroff.ps1 +++ b/Scripts/poweroff.ps1 @@ -1,5 +1,4 @@ -#Requires -RunAsAdministrator -<# +<# .SYNOPSIS poweroff.ps1 .DESCRIPTION @@ -12,6 +11,8 @@ https://github.com/fleschutz/PowerShell #> +#Requires -RunAsAdministrator + try { Stop-Computer exit 0 diff --git a/Scripts/query-smart-data.ps1 b/Scripts/query-smart-data.ps1 index aecd80fb..27d3cebd 100755 --- a/Scripts/query-smart-data.ps1 +++ b/Scripts/query-smart-data.ps1 @@ -1,5 +1,4 @@ -#Requires -RunAsAdministrator -<# +<# .SYNOPSIS query-smart-data.ps1 [] .DESCRIPTION @@ -15,6 +14,8 @@ https://github.com/fleschutz/PowerShell #> +#Requires -RunAsAdministrator + param([string]$Directory = "") diff --git a/Scripts/reboot.ps1 b/Scripts/reboot.ps1 index 517cc3d4..fdd09771 100755 --- a/Scripts/reboot.ps1 +++ b/Scripts/reboot.ps1 @@ -1,5 +1,4 @@ -#Requires -RunAsAdministrator -<# +<# .SYNOPSIS reboot.ps1 .DESCRIPTION @@ -12,6 +11,8 @@ https://github.com/fleschutz/PowerShell #> +#Requires -RunAsAdministrator + try { Restart-Computer exit 0 diff --git a/Scripts/remove-print-jobs.ps1 b/Scripts/remove-print-jobs.ps1 index d92bdf4d..a7c16cb4 100755 --- a/Scripts/remove-print-jobs.ps1 +++ b/Scripts/remove-print-jobs.ps1 @@ -1,5 +1,4 @@ -#requires -version 4 -<# +<# .SYNOPSIS remove-print-jobs.ps1 .DESCRIPTION @@ -12,6 +11,8 @@ https://github.com/fleschutz/PowerShell #> +#Requires -Version 4 + try { $printers = Get-Printer if ($printers.Count -eq 0) { throw "No printer found" } diff --git a/Scripts/restart-network-adapters.ps1 b/Scripts/restart-network-adapters.ps1 index 6a6b42e7..e76fb7a8 100644 --- a/Scripts/restart-network-adapters.ps1 +++ b/Scripts/restart-network-adapters.ps1 @@ -1,5 +1,4 @@ -#Requires -RunAsAdministrator -<# +<# .SYNOPSIS restart-network-adapters.ps1 .DESCRIPTION @@ -12,6 +11,8 @@ htts://github.com/fleschutz/PowerShell #> +#Requires -RunAsAdministrator + try { $StopWatch = [system.diagnostics.stopwatch]::startNew()