Skip to content

Invoke-TssRestApi with -noproxy #411

@freshjewbagel

Description

@freshjewbagel

Summarize Functionality

PowerShell uses system proxy to access internal SS, this fails in our environment.

Invoke-TssRestApi wraps Invoke-RestMethod but I cannot figure out how to pass it -noproxy

How can I use this module against on-prem SS and force -noproxy?

PS C:\> get-module Thycotic.SecretServer

ModuleType Version    PreRelease Name                                ExportedCommands
---------- -------    ---------- ----                                ----------------
Script     0.61.8                Thycotic.SecretServer               {Start-TssLog, Stop-TssLog, Write-TssLog, Add-Tss…

PS C:\> Import-Module Thycotic.SecretServer

PS C:\> $session = New-TssSession https://secretserver.com -UseWindowsAuth -Verbose
VERBOSE: Command invocation: New-TssSession -UseWindowsAuth:True -Verbose:True -SecretServer:True
VERBOSE: UseWindowsAuth provided, setting URL segment to use winauthwebservices
VERBOSE: Setting start time for session: 11/08/2024 15:04:08
VERBOSE: Attempting to retrieve Secret Server host version
VERBOSE: Command invocation: Get-TssVersion -TssSession:TssSessionObject -ErrorAction:TssSessionObject
VERBOSE: Performing the operation GET https://secretserver.com/winauthwebservices/api/v1/version
WARNING: Issue reading version of [https://secretserver.com/], this may be due to Hide Secret Server Version Numbers being disabled. Version support is limited in the module and may affect functionality of some functions.
VERBOSE: SecretServer host: https://secretserver.com/
VERBOSE: ApiUrl: https://secretserver.com/winauthwebservices/api/v1
VERBOSE: Outputing final object

PS C:\> Get-TssVersion -TssSession $session
WARNING: Issue getting version details for [https://secretserver.com/]
ErrorHandling.ps1: C:\Users\user\Documents\PowerShell\Modules\Thycotic.SecretServer\functions\version\Get-TssVersion.ps1:57
Line |
  57 |                  . $ErrorHandling $err
     |                  ~~~~~~~~~~~~~~~~~~~~~
     | The proxy tunnel request to proxy 'http://wwwproxy.com:8080/' failed with status code '403'."

Is there a command that is similar or close to what you are looking for?

No

Technical Details

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions