Skip to content

Commit

Permalink
module InternalEndpointUsed - converting to private binary command, W…
Browse files Browse the repository at this point in the history
…rite-TssInternalNote
  • Loading branch information
wsmelton committed Sep 29, 2021
1 parent 4ea1cb8 commit d3b19f9
Show file tree
Hide file tree
Showing 9 changed files with 34 additions and 21 deletions.
@@ -0,0 +1,27 @@
using System;
using System.Collections.Generic;
using System.Management.Automation;
using System.Management.Automation.Runspaces;

namespace Thycotic.SecretServer.Cmdlets
{
/// <summary>
/// <para type="synopsis">Outputs verbose statement for commands using internal endpoints</para>
/// <para type="description">Outputs verbose statement for commands using internal endpoints</para>
/// </summary>
[Cmdlet(VerbsCommunications.Write, "TssInternalNote")]
public class WriteInternalNote : PSCmdlet
{
///<summary>
///<para type="description">MyInvocation object from the calling command</para>
///</summary>
[Parameter(Mandatory = true, Position = 0, ValueFromPipeline = true, ValueFromPipelineByPropertyName = true)]
public InvocationInfo Invocation {get; set;}

protected override void ProcessRecord()
{
var cmdName = Invocation.MyCommand;
WriteVerbose("[" + cmdName + "] calling an internal endpoint.");
}
}
}
2 changes: 1 addition & 1 deletion src/functions/rpc/Get-TssRpcAssociatedSecret.ps1
Expand Up @@ -41,7 +41,7 @@ function Get-TssRpcAssociatedSecret {
}

process {
. $InternalEndpointUsed $PSCmdlet.MyInvocation
Write-TssInternalNote $PSCmdlet.MyInvocation
Get-TssInvocation $PSCmdlet.MyInvocation
if ($tssParams.ContainsKey('TssSession') -and $TssSession.IsValidSession()) {
Compare-TssVersion $TssSession '10.9.000000' $PSCmdlet.MyInvocation
Expand Down
2 changes: 1 addition & 1 deletion src/functions/secrets/Get-TssSecretHeartbeatStatus.ps1
Expand Up @@ -40,7 +40,7 @@ function Get-TssSecretHeartbeatStatus {
$invokeParams = . $GetInvokeApiParams $TssSession
}
process {
. $InternalEndpointUsed $PSCmdlet.MyInvocation
Write-TssInternalNote $PSCmdlet.MyInvocation
Get-TssInvocation $PSCmdlet.MyInvocation
if ($tssParams.ContainsKey('TssSession') -and $TssSession.IsValidSession()) {
Compare-TssVersion $TssSession '10.9.000000' $PSCmdlet.MyInvocation
Expand Down
2 changes: 1 addition & 1 deletion src/functions/secrets/Get-TssSecretPasswordStatus.ps1
Expand Up @@ -41,7 +41,7 @@ function Get-TssSecretPasswordStatus {
}

process {
. $InternalEndpointUsed $PSCmdlet.MyInvocation
Write-TssInternalNote $PSCmdlet.MyInvocation
Get-TssInvocation $PSCmdlet.MyInvocation
if ($tssParams.ContainsKey('TssSession') -and $TssSession.IsValidSession()) {
Compare-TssVersion $TssSession '10.9.000000' $PSCmdlet.MyInvocation
Expand Down
2 changes: 1 addition & 1 deletion src/functions/secrets/Invoke-TssSecretGeneratePassword.ps1
Expand Up @@ -47,7 +47,7 @@ function Invoke-TssSecretGeneratePassword {
$invokeValidateParams = . $GetInvokeApiParams $TssSession
}
process {
. $InternalEndpointUsed $PSCmdlet.MyInvocation
Write-TssInternalNote $PSCmdlet.MyInvocation
Get-TssInvocation $PSCmdlet.MyInvocation
if ($PSBoundParameters.ContainsKey('TssSession') -and $TssSession.IsValidSession()) {
Compare-TssVersion $TssSession '10.9.000000' $PSCmdlet.MyInvocation
Expand Down
2 changes: 1 addition & 1 deletion src/functions/secrets/Set-TssSecretRpcPrivileged.ps1
Expand Up @@ -56,7 +56,7 @@ function Set-TssSecretRpcPrivileged {
$invokeParams = . $GetInvokeApiParams $TssSession
}
process {
. $InternalEndpointUsed $PSCmdlet.MyInvocation
Write-TssInternalNote $PSCmdlet.MyInvocation
Get-TssInvocation $PSCmdlet.MyInvocation
if ($setParams.ContainsKey('TssSession') -and $TssSession.IsValidSession()) {
Compare-TssVersion $TssSession '10.9.000000' $PSCmdlet.MyInvocation
Expand Down
2 changes: 1 addition & 1 deletion src/functions/secrets/Start-TssSecretChangePassword.ps1
Expand Up @@ -50,7 +50,7 @@ function Start-TssSecretChangePassword {
}

process {
. $InternalEndpointUsed $PSCmdlet.MyInvocation
Write-TssInternalNote $PSCmdlet.MyInvocation
Get-TssInvocation $PSCmdlet.MyInvocation
if ($tssParams.ContainsKey('TssSession') -and $TssSession.IsValidSession()) {
Compare-TssVersion $TssSession '10.9.000000' $PSCmdlet.MyInvocation
Expand Down
Expand Up @@ -75,7 +75,7 @@ function Update-TssSecretRdpLauncherSetting {
$invokeParams = . $GetInvokeApiParams $TssSession
}
process {
. $InternalEndpointUsed $PSCmdlet.MyInvocation
Write-TssInternalNote $PSCmdlet.MyInvocation
Get-TssInvocation $PSCmdlet.MyInvocation
if ($updateLaunchParams.ContainsKey('TssSession') -and $TssSession.IsValidSession()) {
Compare-TssVersion $TssSession '10.9.000000' $PSCmdlet.MyInvocation
Expand Down
14 changes: 0 additions & 14 deletions src/parts/InternalEndpointUsed.ps1

This file was deleted.

0 comments on commit d3b19f9

Please sign in to comment.