Created
July 17, 2020 22:35
-
-
Save Chirishman/4dc8a53b38634d1cd06f474f8f56a698 to your computer and use it in GitHub Desktop.
Invalid Key Type (Somehow)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$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