Skip to content

Commit

Permalink
Code Cleanup - removing use of ToString()
Browse files Browse the repository at this point in the history
  • Loading branch information
wsmelton committed Mar 14, 2021
1 parent 09981c8 commit db3bf67
Show file tree
Hide file tree
Showing 10 changed files with 13 additions and 13 deletions.
2 changes: 1 addition & 1 deletion src/functions/folders/Get-Folder.ps1
Expand Up @@ -66,7 +66,7 @@ function Get-Folder {
. $CheckVersion $TssSession '10.9.000000' $PSCmdlet.MyInvocation
foreach ($folder in $Id) {
$restResponse = $null
$uri = $TssSession.ApiUrl, 'folders', $folder.ToString() -join '/'
$uri = $TssSession.ApiUrl, 'folders', $folder -join '/'
$uri = $uri + '?' + "getAllChildren=$GetChildren" + "&" + "includeAssociatedTemplates=$IncludeTemplate"

$invokeParams.Uri = $Uri
Expand Down
2 changes: 1 addition & 1 deletion src/functions/folders/Remove-Folder.ps1
Expand Up @@ -43,7 +43,7 @@ function Remove-Folder {
. $CheckVersion $TssSession '10.9.000000' $PSCmdlet.MyInvocation
foreach ($folder in $Id) {
$restResponse = $null
$uri = $TssSession.ApiUrl, 'folders', $folder.ToString() -join '/'
$uri = $TssSession.ApiUrl, 'folders', $folder -join '/'
$invokeParams.Uri = $uri
$invokeParams.Method = 'DELETE'

Expand Down
2 changes: 1 addition & 1 deletion src/functions/reports/Get-Report.ps1
Expand Up @@ -43,7 +43,7 @@ function Get-Report {
. $CheckVersion $TssSession '10.9.000000' $PSCmdlet.MyInvocation
foreach ($report in $Id) {
$restResponse = $null
$uri = $TssSession.ApiUrl, 'reports', $report.ToString() -join '/'
$uri = $TssSession.ApiUrl, 'reports', $report -join '/'
$invokeParams.Uri = $uri
$invokeParams.Method = 'GET'

Expand Down
2 changes: 1 addition & 1 deletion src/functions/reports/Get-ReportCategory.ps1
Expand Up @@ -54,7 +54,7 @@ function Get-ReportCategory {
if ($tssReportCatParams['Id']) {
foreach ($reportCategory in $Id) {
$restResponse = $null
$uri = $TssSession.ApiUrl, 'reports/categories', $reportCategory.ToString() -join '/'
$uri = $TssSession.ApiUrl, 'reports/categories', $reportCategory -join '/'
$invokeParams.Uri = $uri
$invokeParams.Method = 'GET'

Expand Down
8 changes: 4 additions & 4 deletions src/functions/reports/Remove-ReportCategory.ps1
Expand Up @@ -49,18 +49,18 @@ function Remove-ReportCategory {
Write-Verbose "Provided command parameters: $(. $GetInvocation $PSCmdlet.MyInvocation)"
if ($tssParams.ContainsKey('TssSession') -and $TssSession.IsValidSession()) {
. $CheckVersion $TssSession '10.9.000000' $PSCmdlet.MyInvocation
foreach ($id in $ReportCategoryId) {
$uri = $TssSession.ApiUrl, 'reports/categories', $id.ToString() -join '/'
foreach ($category in $ReportCategoryId) {
$uri = $TssSession.ApiUrl, 'reports/categories', $category -join '/'
$invokeParams.Uri = $uri
$invokeParams.Method = 'DELETE'


Write-Verbose "$($invokeParams.Method) $uri"
if (-not $PSCmdlet.ShouldProcess("RemoteCategoryId: $id", "$($invokeParams.Method) $uri")) { return }
if (-not $PSCmdlet.ShouldProcess("RemoteCategoryId: $category", "$($invokeParams.Method) $uri")) { return }
try {
$restResponse = Invoke-TssRestApi @invokeParams
} catch {
Write-Warning "Issue removing [$id]"
Write-Warning "Issue removing [$category]"
$err = $_
. $ErrorHandling $err
}
Expand Down
2 changes: 1 addition & 1 deletion src/functions/secrets/Get-SecretField.ps1
Expand Up @@ -88,7 +88,7 @@ function Get-SecretField {
if ($tssParams.ContainsKey('TssSession') -and $TssSession.IsValidSession()) {
. $CheckVersion $TssSession '10.9.000000' $PSCmdlet.MyInvocation
foreach ($secret in $Id) {
$uri = $TssSession.ApiUrl, 'secrets', $secret.ToString() -join '/'
$uri = $TssSession.ApiUrl, 'secrets', $secret -join '/'
$restResponse = $null

$body = @{}
Expand Down
2 changes: 1 addition & 1 deletion src/functions/secrets/Remove-Secret.ps1
Expand Up @@ -42,7 +42,7 @@ function Remove-Secret {
if ($tssParams.ContainsKey('TssSession') -and $TssSession.IsValidSession()) {
. $CheckVersion $TssSession '10.9.000000' $PSCmdlet.MyInvocation
foreach ($secret in $Id) {
$uri = $TssSession.ApiUrl, "secrets", $secret.ToString() -join '/'
$uri = $TssSession.ApiUrl, "secrets", $secret -join '/'

$invokeParams.Uri = $Uri

Expand Down
2 changes: 1 addition & 1 deletion src/functions/secrets/Stop-SecretChangePassword.ps1
Expand Up @@ -42,7 +42,7 @@ function Stop-SecretChangePassword {
. $CheckVersion $TssSession '10.9.000000' $PSCmdlet.MyInvocation
foreach ($secret in $Id) {
$restResponse = $null
$uri = $TssSession.ApiUrl, 'secrets', $secret.ToString(), 'stop-password-change' -join '/'
$uri = $TssSession.ApiUrl, 'secrets', $secret, 'stop-password-change' -join '/'
$invokeParams.Uri = $uri
$invokeParams.Method = 'POST'

Expand Down
2 changes: 1 addition & 1 deletion src/functions/secrettemplates/Get-SecretTemplate.ps1
Expand Up @@ -43,7 +43,7 @@ function Get-SecretTemplate {
. $CheckVersion $TssSession '10.9.000000' $PSCmdlet.MyInvocation
foreach ($template in $Id) {
$restResponse = $null
$uri = $TssSession.ApiUrl, 'secret-templates', $template.ToString() -join '/'
$uri = $TssSession.ApiUrl, 'secret-templates', $template -join '/'
$invokeParams.Uri = $Uri
$invokeParams.Method = 'GET'

Expand Down
2 changes: 1 addition & 1 deletion src/parts/TssVersionObject.ps1
Expand Up @@ -47,7 +47,7 @@ process {
$returnProps = 'Version'
}
'Test-TssVersion' {
$getLatestUrl = "https://updates.thycotic.net/secretserver/LatestVersion.aspx?v=$($outVersion.Version.ToString())"
$getLatestUrl = "https://updates.thycotic.net/secretserver/LatestVersion.aspx?v=$($outVersion.Version)"
Write-Verbose "Accessing $getLatestUrl to validate latest version"
try {
$latest = Invoke-RestMethod -Uri $getLatestUrl -UseBasicParsing
Expand Down

0 comments on commit db3bf67

Please sign in to comment.