Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Function Install-WEBService
- {
- [CmdletBinding()]
- Param
- (
- [Parameter(Position=0, Mandatory=$true, ParameterSetName='1-Settings')]
- [String]$User,
- [Parameter(Position=1,Mandatory=$true,ParameterSetName='1-Settings')]
- [String]$Password,
- [Parameter(ParameterSetName='1-Settings')]
- [ValidateSet("None", "NTLM/Kerberos")]
- [String]$Authentication = "None",
- [Parameter(ParameterSetName='1-Settings')]
- [Alias('Port')]
- [int]${Port [Default is 8550]} = 8550,
- [Parameter(ParameterSetName='1-Settings')]
- [Alias('Url')]
- [String]${Url [Default is OSDInfo]} = "OSDInfo",
- [Parameter(ParameterSetName='1-Settings')]
- [ValidateSet("YES", "NO")]
- [Alias('SSL')]
- [String]${Use SSL [Default is No]} = "NO",
- [Parameter(ParameterSetName='2-About')]
- [Switch]${`n`n`n Web Service Installer by `n`n Diagg/OSD-Couture.com`n`n`n`n`n OS|DC - Quality Deployment since 1884}
- )
- $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
- $RemapAliasTable = @{
- 'Url [Default is OSDInfo]' = 'Url'
- 'Port [Default is 8550]' = 'Port'
- 'Use SSL [Default is No]' = 'SSL'
- }
- $Result = Show-Command Install-WEBService -NoCommonParameter -PassThru
- If (($Result -like "*-user*") -and ($Result -like "*-password*"))
- {
- Foreach ($Item in $RemapAliasTable.GetEnumerator()){If ($Result -match [Regex]::Escape($item.name)){$Result = $Result -replace [Regex]::Escape($Item.Name), $Item.value}}
- Invoke-Expression $Result
- }
- Else
- {Write-Host "Missing parameters, please retry!!"}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement