Skip to content

Commit

Permalink
removing uncessary code
Browse files Browse the repository at this point in the history
  • Loading branch information
wsmelton committed Mar 10, 2021
1 parent 02555a6 commit a691b34
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 89 deletions.
19 changes: 0 additions & 19 deletions src/parts/TssConfigurationGeneralObject.ps1
Expand Up @@ -8,31 +8,12 @@ param(

begin {
$Properties = $Object.PSObject.Properties.Name
if ($Object.applicationSettings) {
$appSettingProperties = $Object.applicationSettings[0].PSObject.Properties.Name
} else {
Write-Verbose "No applicationSettings found on records object"
}
}
process {
if ($appSettingProperties) {
$applicationSettings = [TssConfigurationApplicationSettings]::new()
foreach ($cProp in $appSettingProperties) {
if ($cProp -in $applicationSettings.PSObject.Properties.Name) {
$applicationSettings.$cProp = $Object.applicationSettings.$cProp
} else {
Write-Warning "Property $cProp does not exist in the applicationSettings class. Please create a bug report at https://github.com/thycotic-ps/thycotic.secretserver/issues/new/choose"
}
}
}

$outObject = @()
foreach ($p in $Object) {
$currentObject = [TssConfigurationGeneral]::new()
foreach ($pProp in $Properties) {
if ($pProp -eq 'applicationSettings') {
$currentObject.applicationSettings = $applicationSettings
}
if ($pProp -in $currentObject.PSObject.Properties.Name) {
$currentObject.$pProp = $p.$pProp
} else {
Expand Down
70 changes: 0 additions & 70 deletions src/parts/TssSecretDetailSettingObject.ps1
Expand Up @@ -9,82 +9,12 @@ param(

begin {
$Properties = $Object[0].PSObject.Properties.Name
if ($Object.rdpLauncherSettings) {
$rdpLauncherProps = $Object.rdpLauncherSettings[0].PSObject.Properties.Name
} else {
Write-Verbose "No RdpLauncherSettings found on records object"
}
if ($Object.sshLauncherSettings) {
$sshLauncherProps = $Object.sshLauncherSettings[0].PSObject.Properties.Name
} else {
Write-Verbose "No SshLauncherSettings found on records object"
}
if ($Object.oneTimePasswordSettings) {
$oneTimeProps = $Object.oneTimePasswordSettings[0].PSObject.Properties.Name
} else {
Write-Verbose "No OneTimePasswordSettings found on records object"
}
}

process {
if ($rdpLauncherProps) {
$rdpLauncherSettings = @()
foreach ($rdp in $Object.rdpLauncherSettings) {
$rpdChild = [TssRdpLauncherSettings]::new()
foreach ($cProp in $rdpLauncherProps) {
if ($cProp -in $rpdChild.PSObject.Properties.Name) {
$rpdChild.$cProp = $rdp.$cProp
} else {
Write-Warning "Property $cProp does not exist in the TssRdpLauncherSettings class. Please create a bug report at https://github.com/thycotic-ps/thycotic.secretserver/issues/new/choose"
}
$rdpLauncherSettings += $rpdChild
}
}
}
if ($sshLauncherProps) {
$sshLauncherSettings = @()
foreach ($ssh in $Object.sshLauncherSettings) {
$sshChild = [TssSshLauncherSettings]::new()
foreach ($cProp in $sshLauncherProps) {
if ($cProp -in $sshChild.PSObject.Properties.Name) {
$sshChild.$cProp = $ssh.$cProp
} else {
Write-Warning "Property $cProp does not exist in the TssSshLauncherSettings class. Please create a bug report at https://github.com/thycotic-ps/thycotic.secretserver/issues/new/choose"
}
$sshLauncherSettings += $sshChild
}
}
}
if ($oneTimeProps) {
$oneTimePasswordSettings = @()
foreach ($one in $Object.oneTimePasswordSettings) {
$oneChild = [TssOneTimePasswordSettings]::new()
foreach ($cProp in $oneTimeProps) {
if ($cProp -in $oneChild.PSObject.Properties.Name) {
if ($one.cProp) {
$oneChild.$cProp = $one.$cProp
}
} else {
Write-Warning "Property $cProp does not exist in the TssOneTimePasswordSettings class. Please create a bug report at https://github.com/thycotic-ps/thycotic.secretserver/issues/new/choose"
}
$oneTimePasswordSettings += $oneChild
}
}
}

$outObject = @()
foreach ($p in $Object) {
$currentObject = [TssSecretDetailSettings]::new()
foreach ($pProp In $Properties) {
if ($pProp -eq 'rdpLauncherSettings') {
$currentObject.RdpLauncherSettings = $rdpLauncherSettings
}
if ($pProp -eq 'sshLauncherSettings') {
$currentObject.SshLauncherSettings = $sshLauncherSettings
}
if ($pProp -eq 'oneTimePasswordSettings') {
$currentObject.OneTimePasswordSettings = $oneTimePasswordSettings
}
if ($pProp -in $currentObject.PSObject.Properties.Name) {
if ($p.$pProp) {
$currentObject.$pProp = $p.$pProp
Expand Down

0 comments on commit a691b34

Please sign in to comment.