Add-RDMSessionAttachment

    2024-12-11

    Add-RDMSessionAttachment

    SYNOPSIS

    Add a new attachment to a session

    SYNTAX

    __AllParameterSets

    Add-RDMSessionAttachment [-Session] <PSConnection> [-Filename] <string> [-Description <string>]
     [-Password <securestring>] [-Refresh] [-Title <string>] [-ForcePromptAnswer <DialogResult[]>]
     [<CommonParameters>]
    

    ALIASES

    This cmdlet has the following aliases,

    DESCRIPTION

    Add a new attachment to a session. Two parameters are required: Filename, path to the file to attach, and Session, where the file is attached. Additional information can be provided via the title and description. The attachment can be protected by a password. Only advanced data sources support attachment. The user must have the permission to add attachments.

    EXAMPLES

    EXAMPLE 1

    PS C:> $entry = Get-RDMSession -Name EntryA; Add-RDMSessionAttachment -Filename 'C:\my\path\filename.ext' -Session $entry

    Attach the file filename.ext, located in 'C:\my\path', to the session named EntryA.

    EXAMPLE 2

    PS C:> $entry = Get-RDMSession -Name EntryA; $password = Read-Host -AsSecureString; Add-RDMSessionAttachment -Filename 'C:\my\path\filename.ext' -Session $entry -Description 'A description of the attachment' -Title 'Essential' -Password $password -Refresh

    Attach the file filename.ext, located in 'C:\my\path', to the session named EntryA. The attachment will be protected by the password entered with Read-Host. Additional information is stored. The refresh parameter will update the RDM UI.

    PARAMETERS

    -Description

    Attachment description.

    Type: System.String
    DefaultValue: ''
    SupportsWildcards: false
    ParameterValue: []
    Aliases: []
    ParameterSets:
    - Name: (All)
      Position: Named
      IsRequired: false
      ValueFromPipeline: false
      ValueFromPipelineByPropertyName: false
      ValueFromRemainingArguments: false
    DontShow: false
    AcceptedValues: []
    HelpMessage: ''
    

    -Filename

    Attachment filename.

    Type: System.String
    DefaultValue: ''
    SupportsWildcards: false
    ParameterValue: []
    Aliases: []
    ParameterSets:
    - Name: (All)
      Position: 2
      IsRequired: true
      ValueFromPipeline: true
      ValueFromPipelineByPropertyName: false
      ValueFromRemainingArguments: false
    DontShow: false
    AcceptedValues: []
    HelpMessage: ''
    

    -ForcePromptAnswer

    Switch to use with caution. It will automatically answer prompt asking yes/no, yes/no/cancel, or ok/cancel questions. In case of multiple prompts, multiple values can be passed to this parameter. Here are the accepted values:

    • Yes: Accept the prompt. Cover the OK and Automatic value.
    • No: Refuse the yes/no/cancel prompt. Cancel is the fallback option if there is not an option No.
    • Cancel: Cancel the yes/no/cancel prompt. No is the fallback option if there is not an option Cancel.
    Type: System.Windows.Forms.DialogResult[]
    DefaultValue: ''
    SupportsWildcards: false
    ParameterValue: []
    Aliases: []
    ParameterSets:
    - Name: (All)
      Position: Named
      IsRequired: false
      ValueFromPipeline: false
      ValueFromPipelineByPropertyName: false
      ValueFromRemainingArguments: false
    DontShow: false
    AcceptedValues: []
    HelpMessage: ''
    

    -Password

    Attachment password.

    Type: System.Security.SecureString
    DefaultValue: ''
    SupportsWildcards: false
    ParameterValue: []
    Aliases: []
    ParameterSets:
    - Name: (All)
      Position: Named
      IsRequired: false
      ValueFromPipeline: false
      ValueFromPipelineByPropertyName: false
      ValueFromRemainingArguments: false
    DontShow: false
    AcceptedValues: []
    HelpMessage: ''
    

    -Refresh

    Send refresh notification to Remote Desktop Manager application.

    Type: System.Management.Automation.SwitchParameter
    DefaultValue: ''
    SupportsWildcards: false
    ParameterValue: []
    Aliases: []
    ParameterSets:
    - Name: (All)
      Position: Named
      IsRequired: false
      ValueFromPipeline: false
      ValueFromPipelineByPropertyName: false
      ValueFromRemainingArguments: false
    DontShow: false
    AcceptedValues: []
    HelpMessage: ''
    

    -Session

    Session to add the attachment to.

    Type: RemoteDesktopManager.PowerShellModule.PSOutputObject.PSConnection
    DefaultValue: ''
    SupportsWildcards: false
    ParameterValue: []
    Aliases: []
    ParameterSets:
    - Name: (All)
      Position: 1
      IsRequired: true
      ValueFromPipeline: false
      ValueFromPipelineByPropertyName: false
      ValueFromRemainingArguments: false
    DontShow: false
    AcceptedValues: []
    HelpMessage: ''
    

    -Title

    Attachment title.

    Type: System.String
    DefaultValue: ''
    SupportsWildcards: false
    ParameterValue: []
    Aliases: []
    ParameterSets:
    - Name: (All)
      Position: Named
      IsRequired: false
      ValueFromPipeline: false
      ValueFromPipelineByPropertyName: false
      ValueFromRemainingArguments: false
    DontShow: false
    AcceptedValues: []
    HelpMessage: ''
    

    CommonParameters

    This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutBuffer, -OutVariable, -PipelineVariable, -ProgressAction, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters.

    INPUTS

    System.String

    OUTPUTS

    NOTES

    For more information, type "Get-Help Add-RDMSessionAttachment -detailed". For technical information, type "Get-Help Add-RDMSessionAttachment -full".