我有以下几点:访问PowerShell的属性与空间名
$test = Test-CsWebScheduler -TargetFqdn "pool.int.contoso.com"
Write-Output $test
Target Fqdn : pool.int.contoso.com
Target Uri : https://pool.int.contoso.com/Scheduler/
Result : Failure
Latency : 00:00:00
Error Message : Scheduling conference at
https://pool.int.contoso.com/Scheduler/Handler/WebSchedulerHandler.ashx failed
with status Failure.
Diagnosis :
现在的问题是:
我怎样才能访问“错误信息”,“目标URI”或“目标FQDN “?我可以通过访问结果:
Write-Output $test.result
Failure
没有问题,但该有的都有了里面的空间,我haven't找到了一种方法来访问它们。我尝试以下(发现here):
Write-Output $test."Target Uri"
或
Write-Output $test.{Target Uri}
我也试过如下:
$test | Select-Object -Property "Target Uri"
或
Write-Output ($test."Target Uri")
或非常简单:
$test."Target Uri"
但这不起作用,我没有得到回值(也没有错误)。唯一的错误消息我得到的是,当我使用:
$test | select -ExpandProperty "Target Uri"
select : Property "Target Uri" cannot be found.
At line:1 char:9
+ $test | select -ExpandProperty "Target Uri"
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidArgument: (Microsoft.Rtc.S...s.WebTaskOutput:PSObject) [Selec
t-Object], PSArgumentException
+ FullyQualifiedErrorId : ExpandPropertyNotFound,Microsoft.PowerShell.Commands.SelectObjectCom
mand
有没有人有一个想法如何,我可以访问(没有倾销,要一个临时文件,并解析它)?
更新01:
这里要求是从$测试输出|克
$test | gm
TypeName: Microsoft.Rtc.SyntheticTransactions.WebTaskOutput
Name MemberType Definition
---- ---------- ----------
Equals Method bool Equals(System.Object obj)
GetHashCode Method int GetHashCode()
GetType Method type GetType()
ToString Method string ToString()
Diagnosis Property string Diagnosis {get;}
Error Property string Error {get;}
Latency Property timespan Latency {get;}
Result Property Microsoft.Rtc.SyntheticTransactions.ResultStatus Result {get;}
TargetFqdn Property string TargetFqdn {get;}
TargetUri Property string TargetUri {get;}
WorkflowLogger Property Microsoft.Rtc.SyntheticTransactions.Logging.SyntheticTransactionsWorkf...
'$测试 “目标URI”' - 应做工精细;你可以粘贴(更新问题)从'$ test |输出gm'? – 4c74356b41
是的,我也希望如此,但正如上面所写,情况并非如此。 – BastianW
当我使用'Write-Output($ test。“Target Uri”)'或'$ test。“时,没有什么区别。Target Uri”'...'$ test | gm'现在添加到我的原始发布。 – BastianW