You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The general use of getting the field is that object does not contain the actual file name of the attachment. So it will simply output the content of the attachment, or if you provide the OutFile will properly write the contents to the file name (ensuring PDF for example opens right is not invalid).
If a wrapper exists that uses both functions the Items object of a secret (for the field itself) has the Filename value that can be used to write the file out with the proper name.
Example calls:
# Just dump all attachments to the provided path, will write the file name found on the secret fieldGet-TssSecretAttachment-TssSession $session-SecretId 34,15,213,90-Path 'c:\attachments'
The output of the command itself will include a mapping object that will give: Secret Name, FieldName, and Filename. This should make it usable in a way for importing back to another Secret Server secret (I think).
Shortcut method that could also be introduced: GetAttachment() where this finds the isFile item(s) and outputs the object class TssSecretItem
The text was updated successfully, but these errors were encountered:
$secret=Get-TssSecret ...-Id 54,23,5,7,4,2,5456,4,67# just output the file item details where isFile$secret.GetAttachment()
<# another method has an overload that takes a path this would call Get-TssSecretField (but would require that the session token is still valid)#>$secret.GetAttachment('c:\attachment_directory')
Wrapper function to use the following:
Get-TssSecret
Get-TssSecretField
The general use of getting the field is that object does not contain the actual file name of the attachment. So it will simply output the content of the attachment, or if you provide the
OutFile
will properly write the contents to the file name (ensuring PDF for example opens right is not invalid).If a wrapper exists that uses both functions the Items object of a secret (for the field itself) has the
Filename
value that can be used to write the file out with the proper name.Example calls:
The output of the command itself will include a mapping object that will give: Secret Name, FieldName, and Filename. This should make it usable in a way for importing back to another Secret Server secret (I think).
Shortcut method that could also be introduced:
GetAttachment()
where this finds theisFile
item(s) and outputs the object classTssSecretItem
The text was updated successfully, but these errors were encountered: