腾讯云
开发者社区
文档
建议反馈
控制台
登录/注册
首页
学习
活动
专区
圈层
工具
MCP广场
文章/答案/技术大牛
搜索
搜索
关闭
发布
文章
问答
(9999+)
视频
沙龙
2
回答
无法
输出
PSCustomObject
、
、
我希望将
PSCustomObject
放在一个变量中,以便以后使用。Displayname$x" = $S.displayName $obj = New-Object -TypeName
PSCustomObject
Get-PSCustomObjectAsOutputType 我要求System.Object[]是
PSCustomObject
浏览 26
提问于2020-02-26
得票数 0
回答已采纳
2
回答
检查属性是否为
PSCustomObject
in PowerShell v3
、
、
我创建了一个
PSCustomObject
数组,其中包含几个属性。但是,我
无法
成功地推断一个属性是否是Dictionary/HashTable/
PSCustomObject
。我循环遍历像这样的所有属性。"对于显示为
PSCustomObject
的属性,将
输出
以下内容。我试过用字典和
PSCustomObject
代替HashTable。请注意,检查类型不会有帮助,因为它们看起来都是PSNoteProperty。我如何检查一个属性实际上是一个<
浏览 7
提问于2014-07-24
得票数 0
回答已采纳
1
回答
PowerShell "$g = $json \x\x\x}从-Json组状态转换而来的结果不同于"$g = $json \x\x-Json;$g = $g组状态“;
$data = @( [
PSCustomObject
]@{State="TAIPEI";Type="2"} [
PSCustomObject
]@{State="KH";Type="4&
浏览 4
提问于2020-10-09
得票数 1
回答已采纳
1
回答
格式-从
pscustomobject
中的花括号
输出
列表
、
我正在尝试使用
PSCustomObject
来存储来自远程计算机的大量信息。我似乎
无法
让格式表的
输出
按我想要的方式工作。下面是我用来生成测试
PSCustomObject
和填充其中一个属性的代码。$EnvironmentInfo = [
PSCustomObject
] @{Name=[System.Collections.ArrayList]@(); Description=[System.Collections.ArrayList
浏览 4
提问于2017-03-08
得票数 0
回答已采纳
2
回答
PSCustomobject
返回奇怪
输出
、
、
问题是我想让它至少做两次“测试连接”,但是
输出
是非常奇怪的(从逻辑的角度来看是合理的,但是从
输出
的角度看不是)。下面是代码:如果我使用count参数并将其设置为1次,则
输出
是正确的,它显示了它进行测试的一台pc,如果我将其设置为2,则
输出
将出现混乱。= Test-NetConnection $pc -Port 1433 [
pscustomobject
-
浏览 0
提问于2018-04-06
得票数 1
回答已采纳
1
回答
如何在
pscustomobject
中插入pscustomobjects数组
、
、
、
我试着做一个这样的东西: 'fields' = [
pscustomobject
]@{ 'id' = $releaseId }$bodyJson = $bodyObject | ConvertTo-Json;我得到
浏览 3
提问于2021-03-22
得票数 1
回答已采纳
1
回答
Powershell -
无法
将"System.Management.Automation.
PSCustomObject
“类型的值转换为"System.Management.Automation.
PSCustomObject
、
、
、
CmdletBinding()] [Parameter(Mandatory=$true)]$source是通过解析JSON文件获得的,如下所示:Write-Host $source.GetType()
输出
:我得
浏览 2
提问于2018-03-07
得票数 4
回答已采纳
1
回答
对象中的PowerShell对象
、
、
我有以下代码: Tire = [
PSCustomObject
] @{ } Color = "Blue"} Colo
浏览 3
提问于2020-04-29
得票数 1
回答已采纳
1
回答
格式化百分比小数位并移除尾随零
、
、
考虑以下代码: [
PSCustomObject
]@{ Usage= 6166915072 [
PSCustomObject
]@{ Usage= 5368709120 [
PSCustomObject
]@{
浏览 0
提问于2018-04-26
得票数 3
回答已采纳
1
回答
定义新的或重新定义系统对象的现有自定义方法
朋友们,我如何定义系统对象的新的自定义方法或重新定义现有的方法?Add-Member -InputObject [System.Array] -MemberType "ScriptMethod" -Name "joinSpaces" -Value {return $This -join " "} [System.Array]::joinSpaces -eq $Null #=> True [System.Arr
浏览 1
提问于2018-10-13
得票数 1
回答已采纳
1
回答
PowerShell -函数中的“写
输出
”和“返回”
、
、
、
我使用PowerShell已经有很多年了,我以为我对它的一些“古怪”行为有了一些把握,但是我遇到了一个我
无法
理解的问题.write-host ($y -is [hashtable]) write-host ($y -is [
pscustomobject
])Sy
浏览 1
提问于2018-07-04
得票数 21
回答已采纳
2
回答
在ForEach中使用
pscustomobject
时
无法
获得命令
输出
、
、
我从列表中捕获每个服务的
pscustomobject
中的结果。我得到的
输出
是: : () : Startup Type : 请指点。谢谢
浏览 3
提问于2019-04-25
得票数 0
回答已采纳
3
回答
对象的
输出
出现开始睡眠(或直到脚本结束)的奇怪延迟。
、
、
、
由于某些原因,在睡眠命令完成之前,对象不会
输出
。这是另一个例子。在循环结束之前,您不会看到
输出
。foreach ($i in 1..60) { sleep 1我想您必须
输出
至少两个对象才能看到任何东西foreach ($i in 1..60) { if ($i -eq 1 -or
浏览 4
提问于2019-12-13
得票数 4
回答已采纳
1
回答
将数组数据重新排列到表中
我得到的
输出
如下:但是我想要一个像Excel表一样的
输出
- ID1和Id2在左列,服务在上行,每个ID的总和,服务在下面的表中。$data = @( [
pscustomobject
='3'} [
pscustomobject
]@{Id1=&
浏览 3
提问于2021-09-03
得票数 0
1
回答
在Powershell中从
PSCustomObject
中检索元素
特此显示语句:- Write-Host $Getresponse.GetType()
输出
:- System.Management.Automation.
PSCustomObject
Write-Host $Getresponse | Get-Member -Force
输出
:-@{registered_models=System.Object[]} 我想将$Getresponse的
输出</e
浏览 3
提问于2020-12-13
得票数 0
回答已采纳
2
回答
将Powershell
PSCustomObject
复制到数组元素将传递引用,而不是值。
、
、
不确定我做错了什么,但是当将Powershell中的
PSCustomObject
复制到数组元素时,这是通过引用复制的。见此: albumId = $album_id; description = ""; simpleMediaItem = [
PSCustomObject
浏览 9
提问于2021-12-30
得票数 2
回答已采纳
2
回答
使用格式表和
pscustomobject
我想使用Format-Table -Autosize和
pscustomobject
。我想要相当于:我试过了(尽管
输出
位于中间) [
pscustomobject
Get-Process | %{ ID = $_.Id ProcessName
浏览 3
提问于2015-05-20
得票数 1
回答已采纳
1
回答
带有值表达式的Powershell添加成员。
试图向powershell对象数组中添加新成员,
无法
获得要计算的表达式。下面是一些示例代码:@([
pscustomobject
]@{Name="Cat";Legs=4},[
pscustomobject
]@{Name="Snake";Legs=0}) $testData | Select-Object Name, Legs, @{
浏览 5
提问于2022-10-14
得票数 1
回答已采纳
1
回答
为什么不能根据[string] vs [hashtable] vs [
pscustomobject
]解析参数集?
、
、
、
')] $
PsCustomObject
process $PSCmdlet.ParameterSetName}管道[
pscustomobject
]的行为与我预期的一样:
pscustomobject
我确实注意到了[string]的
输出
包括以下一
浏览 5
提问于2016-10-06
得票数 3
1
回答
使用powershell在数组字符串中创建换行符。
、
、
我试图在字符串中创建一个换行符,以获得数组的格式化
输出
。守则:[
PSCustomObject
]@{Name = "David"; Article = "TShirt"; Size = "S"} [
PSCustomObject
]@{Name= "Eduard"; Article = "extra laaaaaaaaaaaaaaaarge" + "`r`n" + "TShirt";
浏览 1
提问于2020-02-13
得票数 1
回答已采纳
点击加载更多
相关
资讯
Windows PowerShell进阶PSCustomObject
关于zbrush渲染无法输出透明png的解决方案
Linux基础之cd无法进入xargs管道输出的目录问题解决方法
DisplayPort输出和HDMI输出的颜色一致吗?
输出倒逼输入
热门
标签
更多标签
云服务器
ICP备案
对象存储
实时音视频
云直播
活动推荐
运营活动
广告
关闭
领券