AndrewPla / TOPdeskPS

PowerShell module to interact with the TOPdesk API
MIT License
30 stars 12 forks source link

Can't test TOPdeskPS in test environment #30

Closed whatthehomepod closed 5 years ago

whatthehomepod commented 6 years ago

Is your feature request related to a problem? Please describe. Yes, it is not possible to use test environment with the script. For example this is my url: http://tde-test01.null.intra:90/ but Invoke-RestMethod cannot resolve the remote name.

Describe the solution you'd like A way to use test environments, either with '-port 90' variable or that the script automatically reads the port.

Examples of how the solution would work Connect-TdService -url 'http://tde-test01.null.intra/' -port 90 -Credential TOPDESKTEST -PassThru << BASE64 PASSWORD >> -UserType operator

Describe alternatives you've considered n/a

Additional context Invoke-RestMethod : The remote name could not be resolved: 'tde-test01.null.intra' At line:83 char:19 $result = Invoke-RestMethod @parameter -ErrorAction Stop

AndrewPla commented 6 years ago

Good catch. I currently only have access to the SaaS environment, but I will add support for this in the next update.

AndrewPla commented 6 years ago

Can you try running updating the module to the latest version (0.0.6) and running

Connect-TdService -Url 'http://tde-test01.null.intra:90/' -Credential (Get-Credential) -ApplicationPassword You can run a command like Get-TdIncident afterwords to test if things are working. Note: The Credential username will be the username of the account that created the application password. and then the application password is the password that you get from TOPdesk.