Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feature Request] Metadata should be part of the default psformat for SecretInformation #109

Open
JustinGrote opened this issue Mar 4, 2021 · 5 comments

Comments

@JustinGrote
Copy link

Metadata does not appear in the psformat xml for [SecretInformation] and should be present to let users know that it is there.
image

@SydneyhSmith
Copy link
Collaborator

SydneyhSmith commented Mar 8, 2021

Thanks @JustinGrote we chose not to do this by default because metadata can be long and may not output well in the table format, and is not one of the mandatory item, however we will track this feature request and also consider a switch on Get-SecretInfo to also show metadata, plus because metadata is opt in, many vaults may not support it so we would want displaying this information to be opt in as well

@JustinGrote
Copy link
Author

Thanks Sydney, I understand in default table format it may not be super legible and would be truncated with "..." often but I think it is important to expose that it is there so that a user can interrogate it further, otherwise it is fairly "hidden" unless a user is very familiar with Get-Member.

Maybe take a "wait and see" approach if vaults widely adopt metadata or not, since changing the view format would probably not be a breaking change.

I can say all of my vaults will have a use for metadata :)

@jdhitsolutions
Copy link

In the mean time, use a custom format file.

<?xml version="1.0" encoding="UTF-8"?>
<!--
Format type data generated 04/14/2021 18:16:54 by PROSPERO\Jeff

This file was created using the New-PSFormatXML command that is part
of the PSScriptTools module.
https://github.com/jdhitsolutions/PSScriptTools
-->
<Configuration>
  <ViewDefinitions>
    <View>
      <!--Created 04/14/2021 18:16:54 by PROSPERO\Jeff-->
      <Name>meta</Name>
      <ViewSelectedBy>
        <TypeName>Microsoft.PowerShell.SecretManagement.SecretInformation</TypeName>
      </ViewSelectedBy>
      <TableControl>
        <!--Delete the AutoSize node if you want to use the defined widths.-->
        <AutoSize />
        <TableHeaders>
          <TableColumnHeader>
            <Label>Name</Label>
            <Width>7</Width>
            <Alignment>left</Alignment>
          </TableColumnHeader>
          <TableColumnHeader>
            <Label>Type</Label>
            <Width>9</Width>
            <Alignment>left</Alignment>
          </TableColumnHeader>
          <TableColumnHeader>
            <Label>VaultName</Label>
            <Width>12</Width>
            <Alignment>left</Alignment>
          </TableColumnHeader>
          <TableColumnHeader>
            <Label>Metadata</Label>
            <Width>83</Width>
            <Alignment>left</Alignment>
          </TableColumnHeader>
        </TableHeaders>
        <TableRowEntries>
          <TableRowEntry>
            <TableColumnItems>
              <TableColumnItem>
                <PropertyName>Name</PropertyName>
              </TableColumnItem>
              <TableColumnItem>
                <PropertyName>Type</PropertyName>
              </TableColumnItem>
              <TableColumnItem>
                <PropertyName>VaultName</PropertyName>
              </TableColumnItem>
              <TableColumnItem>
                <PropertyName>Metadata</PropertyName>
              </TableColumnItem>
            </TableColumnItems>
          </TableRowEntry>
        </TableRowEntries>
      </TableControl>
    </View>
  </ViewDefinitions>
</Configuration>

Save the file and use Update-FormatData. Then use the view.

image

@JustinGrote
Copy link
Author

JustinGrote commented Apr 14, 2021

@jdhitsolutions well obviously, this is more for new users of the module who don't even know the metadata is a thing and don't know they can do advanced filtering of secrets using Where-Object using it. If they know enough to do a custom type data then they know enough about Get-Member :)

@jdhitsolutions
Copy link

I wonder if metadata use is more module specific. The LastPass secrets module might use metadata differently than say the KeePass module than 1Password which might not use it at all. Perhaps commands to use metadata are the responsibility of the individual secretmanagement modules

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants