PowerShell:带有用户配置文件列表(Get-ChildItem -path \\ $ enk:computername \ c $ \ users \)的外浏览量
基本用法问题:
当我运行
Get-ChildItem -path \\$env:COMPUTERNAME\c$\users\ | Out-GridView -Title "Select from User Accounts" -PassThru
全部看起来不错时,我将获得一个不错的弹出对话框,其中一个用户帐户可从每行一个帐户中选择。 和名称(完美,我会在稍后选择名称,然后在那里挑选持久时间
。
$useraccountsall = Get-ChildItem -path \\$env:COMPUTERNAME\c$\users\
$useraccounts = Out-GridView -InputObject $useraccountsall -PassThru -Title "Select from User Accounts"
字段是模式,持久时期,长度 列,例如: 长度,长度,等级,Syncroot,isReadonly,iSfixedSize,Issyngronized,计数 Syncroot似乎包含用户名列表,也许包含更多信息。
问:如何更改第二个代码以显示像第一个的GridView输出?
Basic usage question:
When I run
Get-ChildItem -path \\$env:COMPUTERNAME\c$\users\ | Out-GridView -Title "Select from User Accounts" -PassThru
all looks good, I get a nice pop-up dialog with user accounts to pick from, one account per row. Fields are Mode, LastWriteTime, Length, and Name (perfect, I'll pick out Name and LastWriteTime later, OK there.)
However, when I make it a variable in between, lisk this...
$useraccountsall = Get-ChildItem -path \\$env:COMPUTERNAME\c$\users\
$useraccounts = Out-GridView -InputObject $useraccountsall -PassThru -Title "Select from User Accounts"
I get one row with many unfamiliar columns, like:
Length, LongLength, Rank, SyncRoot, IsReadOnly, IsFixedSize, IsSynchronized, Count
SyncRoot seems to contain the list of usernames, and maybe more info.
Q: How do I change the second code to show GridView output like the first?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
谢谢Santiago Squarzon!得到它,跳过-utputObject,只需将其输入即可。
Thank you Santiago Squarzon! Got it, skip -InputObject, just pipe it in.