Skip to content

Commit 4ad54d8

Browse files
author
Ricky Lee
committed
Just changed tab alignment. Nothing else
1 parent a4e1e86 commit 4ad54d8

File tree

1 file changed

+23
-23
lines changed

1 file changed

+23
-23
lines changed

Convert-SecureStringText.ps1

Lines changed: 23 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,26 @@
11
function Convert-SecureStringText {
2-
<#
3-
Objective: Convert between plaintext and SecureString text
4-
#>
5-
[cmdletbinding()]
6-
param (
7-
[Parameter(Mandatory=$true)]
8-
[ValidateSet("to","from")]
9-
[string]$action,
10-
[Parameter(Mandatory=$true, ValueFromPipeline=$true)]
11-
[string]$MyInput
12-
)
13-
14-
Try {
15-
If ($action -eq "to") {
16-
$result = $MyInput.Trim() | ConvertTo-SecureString -AsPlainText -Force | ConvertFrom-SecureString -ErrorAction SilentlyContinue
17-
}
18-
else {
19-
$result = [Net.NetworkCredential]::new('', (($MyInput.Trim()) |ConvertTo-SecureString)).password
20-
}
21-
return $result
2+
<#
3+
Objective: Convert between plaintext and SecureString text
4+
#>
5+
[cmdletbinding()]
6+
param (
7+
[Parameter(Mandatory=$true)]
8+
[ValidateSet("to","from")]
9+
[string]$action,
10+
[Parameter(Mandatory=$true, ValueFromPipeline=$true)]
11+
[string]$MyInput
12+
)
13+
14+
Try {
15+
If ($action -eq "to") {
16+
$result = $MyInput.Trim() | ConvertTo-SecureString -AsPlainText -Force | ConvertFrom-SecureString -ErrorAction SilentlyContinue
2217
}
23-
catch {
24-
Write-Warning "Unable to convert.....`n`n$($_.Exception)"
18+
else {
19+
$result = [Net.NetworkCredential]::new('', (($MyInput.Trim()) |ConvertTo-SecureString)).password
2520
}
26-
}
21+
return $result
22+
}
23+
catch {
24+
Write-Warning "Unable to convert.....`n`n$($_.Exception)"
25+
}
26+
}

0 commit comments

Comments
 (0)