Skip to content

Instantly share code, notes, and snippets.

@Diagg
Last active April 15, 2019 14:44
Show Gist options
  • Select an option

  • Save Diagg/879eeda5179ff01a2eef6b8739c67867 to your computer and use it in GitHub Desktop.

Select an option

Save Diagg/879eeda5179ff01a2eef6b8739c67867 to your computer and use it in GitHub Desktop.
This is another example on using Show-command to create simple user interface
Function Install-WEBService
{
[CmdletBinding()]
Param
(
[Parameter(Mandatory=$true,position=0)]
[String]${_0_User},
[Parameter(Mandatory=$true,position=1)]
[String]${_1_Password},
[ValidateSet("None", "NTLM/Kerberos")]
[String]$Authentication = "None",
[int]${Port [Default is 8550]} = 8550,
[String]${Url [Default is OSDInfo]} = "OSDInfo",
[ValidateSet("YES", "NO")]
[String]${Use SSL [Default is No]} = "NO"
)
$User = ${_0_User}
$Password = ${_1_Password}
$Port = ${Port [Default is 8550]}
$url = ${Url [Default is OSDInfo]}
$SSL = ${Use SSL [Default is No]}
Write-Host "User: $User"
Write-Host "Password: $Password"
Write-Host "Authentication: $Authentication"
Write-Host "Port: $Port"
Write-Host "URL: $url"
Write-Host "ssl: $ssl"
}
cls
$Result = Show-Command Install-WEBService -NoCommonParameter -PassThru
Invoke-Expression $Result
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment