Skip to content

Instantly share code, notes, and snippets.

@Chirishman
Created July 17, 2020 22:35
Show Gist options
  • Save Chirishman/4dc8a53b38634d1cd06f474f8f56a698 to your computer and use it in GitHub Desktop.
Save Chirishman/4dc8a53b38634d1cd06f474f8f56a698 to your computer and use it in GitHub Desktop.
Invalid Key Type (Somehow)
$AllProperties = @(
'Title',
'Subject',
'Author',
'Keywords',
'Comments',
'Template',
'Last Author',
'Revision Number',
'Application Name',
'Last Print Date',
'Creation Date',
'Last Save Time',
'Total Editing Time',
'Number of Pages',
'Number of Words',
'Number of Characters',
'Security',
'Category',
'Format',
'Manager',
'Company',
'Number of Bytes',
'Number of Lines',
'Number of Paragraphs',
'Number of Slides',
'Number of Notes',
'Number of Hidden Slides',
'Number of Multimedia Clips'
)
[System.Collections.ArrayList]$NewColumns = @()
$AllProperties | %{
[void]$NewColumns.Add(@{
'Name' = $_;
'Expression' = {1}
})
}
$true | select $NewColumns
# This returns the following error:
# The "Name" key has a type, System.Management.Automation.PSObject, that is not valid; expected type is System.String
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment