Получить конкретные значения полей с помощью команды Get-Webbinding в Powershell 2 - PullRequest
0 голосов
/ 03 июля 2018

Я вызываю команду:

$a = Invoke-Command -Computername $system -Scriptblock {import-module WebAdministration;Get-Webbinding}

Результат, который я получаю, выглядит примерно так:

protocol             : http
bindingInformation   : *****
isDsMapperEnabled    : False
certificateHash      : 
certificateStoreName : 
ItemXPath            : /system.applicationHost/sites/s............
PSComputerName       : qwrqwrr
RunspaceId           : qweqwrqwrqwr
PSShowComputerName   : True
Attributes           : {Microsoft.IIs........}
ChildElements        : {}
ElementTagName       : binding
Methods              : {Microsoft.IIs.PowerShell.........}
Schema               : Microsoft.IIs.PowerShell.Framework.ConfigurationElementSchema

protocol             : https
bindingInformation   : ******
isDsMapperEnabled    : False
certificateHash      : sdfghjkjhgfdsdfghgfdsasdfg
certificateStoreName : My
ItemXPath            : /system.applicationHost/sites/s............
PSComputerName       : qwrqwrr
RunspaceId           : qweqwrqwrqwr
PSShowComputerName   : True
Attributes           : {Microsoft.IIs........}
ChildElements        : {}
ElementTagName       : binding
Methods              : {Microsoft.IIs.PowerShell.........}
Schema               : Microsoft.IIs.PowerShell.Framework.ConfigurationElementSchema

теперь я пытаюсь захватить значения в полях protocol, bindingInformation, certificateHash и т. Д. И использовать их где-то еще. как я пытался $a.protocol, который не работает, так что если кто-нибудь может помочь мне здесь, так как я новичок в powershell. Я хочу получить значения из переменной $ a, которую я создал.

...