You've already forked SharedScripts
mirror of
https://github.com/jaapbrasser/SharedScripts.git
synced 2026-06-14 00:14:16 +02:00
Error handling and updated help
This commit is contained in:
@@ -10,7 +10,7 @@ Uses netsh to retrieve all wifi profiles and then extract the corrosponding pass
|
||||
The name of the network profile to be retrieved, by default all profiles are retrieved
|
||||
|
||||
.NOTES
|
||||
Name: New-ZeroFile
|
||||
Name: Get-WifiProfilePassword
|
||||
Author: Jaap Brasser
|
||||
DateCreated: 2017-10-01
|
||||
DateUpdated: 2017-10-03
|
||||
@@ -25,14 +25,38 @@ Get-WifiProfilePassword
|
||||
|
||||
Description
|
||||
-----------
|
||||
Retrieves all the passwords and profiles
|
||||
Retrieves all the wifi passwords for each saved network on this system
|
||||
|
||||
.EXAMPLE
|
||||
"Wifi Profile 1","Jaap's wifi" | Get-WifiProfilePassword
|
||||
|
||||
Description
|
||||
-----------
|
||||
Retrieves the wifi passwords for "Wifi Profile 1" and "Jaap's wifi" by using pipelining
|
||||
|
||||
.EXAMPLE
|
||||
Get-WifiProfilePassword -WifiProfile "Wifi Profile 1","Jaap's wifi"
|
||||
|
||||
Description
|
||||
-----------
|
||||
Retrieves the wifi passwords for "Wifi Profile 1" and "Jaap's wifi"
|
||||
#>
|
||||
|
||||
|
||||
param(
|
||||
[Parameter(
|
||||
Mandatory = $false,
|
||||
ValueFromPipeline = $true
|
||||
)]
|
||||
[string[]] $WifiProfile
|
||||
)
|
||||
|
||||
begin {
|
||||
if (-not (Get-Command -Name netsh.exe -CommandType Application -ErrorAction SilentlyContinue)) {
|
||||
throw 'Netsh not found on this system, script terminated'
|
||||
}
|
||||
}
|
||||
|
||||
process {
|
||||
if ($WifiProfile) {
|
||||
foreach ($CurrentWifi in $WifiProfile) {
|
||||
|
||||
Reference in New Issue
Block a user