update pwsh style
This commit is contained in:
parent
3aa126d64c
commit
cdd58bc167
@ -21,7 +21,7 @@ function Test-CSCertificate {
|
|||||||
|
|
||||||
[CmdletBinding()]
|
[CmdletBinding()]
|
||||||
[OutputType([bool])]
|
[OutputType([bool])]
|
||||||
param(
|
param (
|
||||||
[Parameter(Mandatory = $true)]
|
[Parameter(Mandatory = $true)]
|
||||||
[ValidateNotNullOrEmpty()]
|
[ValidateNotNullOrEmpty()]
|
||||||
[ValidateSet('Private', 'Shared')]
|
[ValidateSet('Private', 'Shared')]
|
||||||
|
@ -21,14 +21,6 @@ function Test-CSConnection {
|
|||||||
|
|
||||||
.EXAMPLE
|
.EXAMPLE
|
||||||
Test-CMConnection -RemoteHost "vcr01.internal.net" -Type VMware
|
Test-CMConnection -RemoteHost "vcr01.internal.net" -Type VMware
|
||||||
|
|
||||||
.NOTES
|
|
||||||
- File Name : Test-CSConnection.ps1
|
|
||||||
- Author : Marco Blessing - marco.blessing@googlemail.com
|
|
||||||
- Requires :
|
|
||||||
|
|
||||||
.LINK
|
|
||||||
https://github.com/OCram85/PSCredentialStore
|
|
||||||
#>
|
#>
|
||||||
|
|
||||||
[CmdletBinding()]
|
[CmdletBinding()]
|
||||||
@ -38,7 +30,7 @@ function Test-CSConnection {
|
|||||||
[ValidateNotNullOrEmpty()]
|
[ValidateNotNullOrEmpty()]
|
||||||
[string]$RemoteHost,
|
[string]$RemoteHost,
|
||||||
|
|
||||||
[Parameter(Mandatory = $True)]
|
[Parameter(Mandatory = $true)]
|
||||||
[ValidateNotNullOrEmpty()]
|
[ValidateNotNullOrEmpty()]
|
||||||
[ValidateSet("CiscoUcs", "FTP", "NetAppFAS", "VMware")]
|
[ValidateSet("CiscoUcs", "FTP", "NetAppFAS", "VMware")]
|
||||||
[string]$Type
|
[string]$Type
|
||||||
|
@ -29,13 +29,14 @@ function Test-CredentialStoreItem {
|
|||||||
[None]
|
[None]
|
||||||
|
|
||||||
.EXAMPLE
|
.EXAMPLE
|
||||||
If (Test-CredentialStoreItem -RemoteHost "Default") {
|
if (Test-CredentialStoreItem -RemoteHost "Default") {
|
||||||
Get-CredentialStoreItem -RemoteHost "Default"
|
Get-CredentialStoreItem -RemoteHost "Default"
|
||||||
}
|
}
|
||||||
Else {
|
else {
|
||||||
Write-Warning ("The given Remote Host {0} does not exist in the credential Store!" -f $RemoteHost)
|
Write-Warning ("The given Remote Host {0} does not exist in the credential Store!" -f $RemoteHost)
|
||||||
}
|
}
|
||||||
#>
|
#>
|
||||||
|
|
||||||
[CmdletBinding(DefaultParameterSetName = 'Private')]
|
[CmdletBinding(DefaultParameterSetName = 'Private')]
|
||||||
[OutputType([bool])]
|
[OutputType([bool])]
|
||||||
param (
|
param (
|
||||||
|
@ -8,7 +8,8 @@ function Get-ModuleBase {
|
|||||||
|
|
||||||
.OUTPUTS
|
.OUTPUTS
|
||||||
Returns the base path as string
|
Returns the base path as string
|
||||||
#>
|
#>
|
||||||
|
|
||||||
[CmdletBinding()]
|
[CmdletBinding()]
|
||||||
[OutputType([string])]
|
[OutputType([string])]
|
||||||
param ()
|
param ()
|
||||||
|
@ -14,12 +14,13 @@ function Get-TempDir {
|
|||||||
.EXAMPLE
|
.EXAMPLE
|
||||||
Get-TempDir
|
Get-TempDir
|
||||||
#>
|
#>
|
||||||
|
|
||||||
[CmdletBinding()]
|
[CmdletBinding()]
|
||||||
[OutputType([string])]
|
[OutputType([string])]
|
||||||
param ()
|
param ()
|
||||||
|
|
||||||
begin {}
|
begin {}
|
||||||
|
|
||||||
process {
|
process {
|
||||||
if ($IsLinux) {
|
if ($IsLinux) {
|
||||||
return (Resolve-Path -Path '/tmp/').Path
|
return (Resolve-Path -Path '/tmp/').Path
|
||||||
@ -27,10 +28,14 @@ function Get-TempDir {
|
|||||||
if ($IsMacOS) {
|
if ($IsMacOS) {
|
||||||
return (Resolve-Path -Path '/tmp/').Path
|
return (Resolve-Path -Path '/tmp/').Path
|
||||||
}
|
}
|
||||||
elseif (($isWindows) -or ($PSVersionTable.PSVersion.Major -lt 6) -or ($PSVersionTable.PSEdition -eq 'Desktop')) {
|
elseif (
|
||||||
|
($isWindows) -or
|
||||||
|
($PSVersionTable.PSVersion.Major -lt 6) -or
|
||||||
|
($PSVersionTable.PSEdition -eq 'Desktop')
|
||||||
|
) {
|
||||||
return (Resolve-Path -Path $env:TEMP).Path
|
return (Resolve-Path -Path $env:TEMP).Path
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
end {
|
|
||||||
}
|
end {}
|
||||||
}
|
}
|
||||||
|
@ -70,7 +70,7 @@ function Import-CSPfxCertificate {
|
|||||||
$_.Exception.Message | Write-Error -ErrorAction Stop
|
$_.Exception.Message | Write-Error -ErrorAction Stop
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
process {
|
process {
|
||||||
try {
|
try {
|
||||||
$cert = [System.Security.Cryptography.X509Certificates.X509Certificate2]::new(
|
$cert = [System.Security.Cryptography.X509Certificates.X509Certificate2]::new(
|
||||||
|
@ -27,7 +27,7 @@ function Test-CSPfxCertificate {
|
|||||||
|
|
||||||
[CmdletBinding()]
|
[CmdletBinding()]
|
||||||
[OutputType([bool])]
|
[OutputType([bool])]
|
||||||
param(
|
param (
|
||||||
[Parameter(Mandatory = $true, ValueFromPipeline = $true)]
|
[Parameter(Mandatory = $true, ValueFromPipeline = $true)]
|
||||||
[ValidateNotNullOrEmpty()]
|
[ValidateNotNullOrEmpty()]
|
||||||
[string]$Thumbprint,
|
[string]$Thumbprint,
|
||||||
|
@ -33,9 +33,10 @@ function Test-Module {
|
|||||||
.EXAMPLE
|
.EXAMPLE
|
||||||
.\Test-Dependency -Name 'VMware.PowerCLI' -Type 'Module' -StopIfFails
|
.\Test-Dependency -Name 'VMware.PowerCLI' -Type 'Module' -StopIfFails
|
||||||
#>
|
#>
|
||||||
|
|
||||||
[OutputType([bool])]
|
[OutputType([bool])]
|
||||||
[CmdletBinding()]
|
[CmdletBinding()]
|
||||||
param(
|
param (
|
||||||
[Parameter(Mandatory = $true)]
|
[Parameter(Mandatory = $true)]
|
||||||
[ValidateNotNullOrEmpty()]
|
[ValidateNotNullOrEmpty()]
|
||||||
[string]$Name,
|
[string]$Name,
|
||||||
|
@ -242,6 +242,5 @@ function New-CredentialStore {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
end {
|
end {}
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
@ -16,8 +16,8 @@ function Test-CredentialStore {
|
|||||||
|
|
||||||
.EXAMPLE
|
.EXAMPLE
|
||||||
Test-CredentialStore -eq $true
|
Test-CredentialStore -eq $true
|
||||||
|
|
||||||
#>
|
#>
|
||||||
|
|
||||||
[CmdletBinding(DefaultParameterSetName = 'Private')]
|
[CmdletBinding(DefaultParameterSetName = 'Private')]
|
||||||
[OutputType([bool])]
|
[OutputType([bool])]
|
||||||
param (
|
param (
|
||||||
|
Loading…
Reference in New Issue
Block a user