Title: Get-Item for files outputs PSObject instead of FileSystemInfo after Get-WmiObject · Issue #12014 · PowerShell/PowerShell · GitHub
Open Graph Title: Get-Item for files outputs PSObject instead of FileSystemInfo after Get-WmiObject · Issue #12014 · PowerShell/PowerShell
X Title: Get-Item for files outputs PSObject instead of FileSystemInfo after Get-WmiObject · Issue #12014 · PowerShell/PowerShell
Description: Get-Item normally outputs System.IO.FileInfo or System.IO.DirectoryInfo objects for the FileSystem provider. After invoking Get-WmiObject, however, Get-Item outputs PSObject objects instead. This causes binding to any command expecting o...
Open Graph Description: Get-Item normally outputs System.IO.FileInfo or System.IO.DirectoryInfo objects for the FileSystem provider. After invoking Get-WmiObject, however, Get-Item outputs PSObject objects instead. This c...
X Description: Get-Item normally outputs System.IO.FileInfo or System.IO.DirectoryInfo objects for the FileSystem provider. After invoking Get-WmiObject, however, Get-Item outputs PSObject objects instead. This c...
Opengraph URL: https://github.com/PowerShell/PowerShell/issues/12014
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Get-Item for files outputs PSObject instead of FileSystemInfo after Get-WmiObject","articleBody":"`Get-Item` normally outputs System.IO.FileInfo or System.IO.DirectoryInfo objects for the FileSystem provider. After invoking `Get-WmiObject`, however, `Get-Item` outputs PSObject objects instead. This causes binding to any command expecting one of the specific FileSystemInfo types to fail.\r\n\r\n# Steps to reproduce\r\n\r\n```powershell\r\n(Get-Item .).GetType().Name\r\nGet-WmiObject bogus -ea si\r\n(Get-Item .).GetType().Name\r\n```\r\n\r\n# Expected behavior\r\n\r\n```none\r\nDirectoryInfo\r\nDirectoryInfo\r\n```\r\n\r\n# Actual behavior\r\n\r\n```none\r\nDirectoryInfo\r\nPSObject\r\n```\r\n\r\n# Environment data\r\n\r\n\u003c!-- provide the output of $PSVersionTable --\u003e\r\n\r\n```none\r\n\r\nName Value\r\n---- -----\r\nPSVersion 7.0.0-rc.2\r\nPSEdition Core\r\nGitCommitId 7.0.0-rc.2\r\nOS Microsoft Windows 6.3.9600\r\nPlatform Win32NT\r\nPSCompatibleVersions {1.0, 2.0, 3.0, 4.0…}\r\nPSRemotingProtocolVersion 2.3\r\nSerializationVersion 1.1.0.1\r\nWSManStackVersion 3.0\r\n```\r\n","author":{"url":"https://github.com/alx9r","@type":"Person","name":"alx9r"},"datePublished":"2020-03-04T22:22:07.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":19},"url":"https://github.com/12014/PowerShell/issues/12014"}
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:a9569828-8b5b-a1ce-6bc0-3642ecd8b567 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | B720:3B609C:356609:494680:6A5519F0 |
| html-safe-nonce | cc1df3f59b9969924183b9194a40a1181fc81566c5ac7f0669563c173b4b16b7 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJCNzIwOjNCNjA5QzozNTY2MDk6NDk0NjgwOjZBNTUxOUYwIiwidmlzaXRvcl9pZCI6IjEyMDUxMzM0MjY2NDg0ODg0MzMiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | d59c42c4c5a845b9b338577cfd37ed5cdd481e7756181b430db187962953a1f1 |
| hovercard-subject-tag | issue:575831314 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/PowerShell/PowerShell/12014/issue_layout |
| twitter:image | https://opengraph.githubassets.com/2aefb50528dd643682e3063caec986b3face8ac483d7ddf53de772d320b49852/PowerShell/PowerShell/issues/12014 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/2aefb50528dd643682e3063caec986b3face8ac483d7ddf53de772d320b49852/PowerShell/PowerShell/issues/12014 |
| og:image:alt | Get-Item normally outputs System.IO.FileInfo or System.IO.DirectoryInfo objects for the FileSystem provider. After invoking Get-WmiObject, however, Get-Item outputs PSObject objects instead. This c... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | alx9r |
| hostname | github.com |
| expected-hostname | github.com |
| None | 682d273eacb2ac51680c6eb9c0b270f029f7ce74c32090f319083c34497e28a5 |
| turbo-cache-control | no-preview |
| go-import | github.com/PowerShell/PowerShell git https://github.com/PowerShell/PowerShell.git |
| octolytics-dimension-user_id | 11524380 |
| octolytics-dimension-user_login | PowerShell |
| octolytics-dimension-repository_id | 49609581 |
| octolytics-dimension-repository_nwo | PowerShell/PowerShell |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 49609581 |
| octolytics-dimension-repository_network_root_nwo | PowerShell/PowerShell |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 3b6d37c6470adadff4194742daaab9a817cc4980 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width