使用 AppFabric Cmdlet 來設定服務中繼資料
您可使用下列 Cmdlet 設定、取得或清除服務中繼資料組態設定。
Cmdlet |
描述 |
Get-ASAppServiceMetadata |
在與所指定範圍相關聯的組態檔中,取得 serviceMetadata 元素的 httpGetEnabled 及 httpGetUrl 屬性值。 |
Set-ASAppServiceMetadata |
在與所指定範圍相關聯的組態檔中,設定 serviceMetadata 元素的 httpGetEnabled 屬性值。如果 serviceMetadata 元素不存在,則 Cmdlet 會新增此元素,並在此元素上設定 httpGetEnabled 屬性值。 |
Clear-ASAppServiceMetadata |
從與所指定範圍相關聯的組態檔中,移除 serviceMetadata 元素。 |
Get-ASAppServiceMetadata Cmdlet 的語法選項
// to get service-metadata settings at the root level
Get-ASAppServiceMetadata –root
// Web site level
Get-ASAppServiceMetadata -SiteName <String>
Example:
Get-ASAppServiceMetadata –SiteName “Default Web Site”
// At the level pointed by the virtual path
Get-ASAppServiceMetadata -SiteName <String> -VirtualPath <string>
Examples:
Get-ASAppServiceMetadata –SiteName “Default Web Site” –VirtualPath /SampleApp
Get-ASAppServiceMetadata –SiteName “Default Web Site” –VirtualPath “/SampleApp/SampleService.xamlx”
// At the level pointed by the URI
Get-ASAppServiceMetadata –Uri <Uri>
Examples:
Get-ASAppServiceMetadata –Uri https://localhost
Get-ASAppServiceMetadata –Uri https://localhost/SampleService
Get-ASAppServiceMetadata –Uri https://localhost/SampleService/SampleService.xamlx
// At the application level specified by using the ApplicationObject
Get-ASAppServiceMetadata –ApplicationObject <ApplicationInfo>
Example:
Get-ASApplication -SiteName "Default Web Site" -VirtualPath /SampleApp | Get-ASAppServiceMetadata
// At the service level specified by using the ServiceInfo object
Get-ASAppServiceMetadata –ServiceObject <ServiceInfo>
Example:
Get-ASAppService –SiteName “Default Web Site” –VirtualPath “/SampleApp/SampleService.xamlx” | Get-ASAppServiceMetadata
Set-ASAppServiceMetadata Cmdlet 的語法選項
// to set service-metadata settings at the root level
Set-ASAppServiceMetadata –root –httpGetEnabled <Boolean>
Example:
Set-ASAppServiceMetadata –root –httpGetEnabled 1
// Web site level
Set-ASAppServiceMetadata -SiteName <String> –httpGetEnabled 1
Example:
Set-ASAppServiceMetadata –SiteName “Default Web Site” –httpGetEnabled 1
// At the level pointed by the virtual path
Set-ASAppServiceMetadata -SiteName <String> -VirtualPath <string> –httpGetEnabled <Boolean>
Examples:
Set-ASAppServiceMetadata –SiteName “Default Web Site” –VirtualPath /SampleApp –httpGetEnabled 1
Set-ASAppServiceMetadata –SiteName “Default Web Site” –VirtualPath “/SampleApp/SampleService.xamlx” –httpGetEnabled 1
// At the level pointed by the URI
Set-ASAppServiceMetadata –Uri <Uri> –httpGetEnabled <Boolean>
Examples:
Set-ASAppServiceMetadata –Uri https://localhost –httpGetEnabled 1
Set-ASAppServiceMetadata –Uri https://localhost/SampleService -httpGetEnabled 1
Set-ASAppServiceMetadata –Uri https://localhost/SampleService/SampleService.xamlx -httpGetEnabled 1
// At the application level specified by using the ApplicationObject
Set-ASAppServiceMetadata –ApplicationObject <ApplicationInfo> –httpGetEnabled <Boolean>
Example:
Get-ASApplication -SiteName "Default Web Site" -VirtualPath /SampleApp | Set-ASAppServiceMetadata –httpGetEnabled 1
// At the service level specified by using the ServiceInfo object
Set-ASAppServiceMetadata –ServiceObject <ServiceInfo> –httpGetEnabled <Boolean>
Example:
Get-ASAppService –SiteName “Default Web Site” –VirtualPath “/SampleApp/SampleService.xamlx” | Set-ASAppServiceMetadata –httpGetEnabled 1
Set-ASAppServiceMetadata Cmdlet 特有的參數
參數 | 描述 |
---|---|
httpGetEnabled |
指定是否可以透過 HTTP 通訊協定存取服務的中繼資料。 |
Clear-ASAppServiceMetadata Cmdlet 的語法選項
// to clear service-metadata settings at the root level
Clear-ASAppServiceMetadata –root
// Web site level
Clear-ASAppServiceMetadata -SiteName <String>
Example:
Clear-ASAppServiceMetadata –SiteName “Default Web Site”
// At the level pointed by the virtual path
Clear-ASAppServiceMetadata -SiteName <String> -VirtualPath <string>
Examples:
Clear-ASAppServiceMetadata –SiteName “Default Web Site” –VirtualPath /SampleApp
Clear-ASAppServiceMetadata –SiteName “Default Web Site” –VirtualPath “/SampleApp/SampleService.xamlx”
// At the level pointed by the URI
Clear-ASAppServiceMetadata –Uri <Uri>
Examples:
Clear-ASAppServiceMetadata –Uri https://localhost
Clear-ASAppServiceMetadata –Uri https://localhost/SampleService
Clear-ASAppServiceMetadata –Uri https://localhost/SampleService/SampleService.xamlx
// At the application level specified by using the ApplicationObject
Clear-ASAppServiceMetadata –ApplicationObject <ApplicationInfo>
Example:
Get-ASApplication -SiteName "Default Web Site" -VirtualPath /SampleApp | Clear-ASAppServiceMetadata
// At the service level specified by using the ServiceInfo object
Clear-ASAppServiceMetadata –ServiceObject <ServiceInfo>
Example:
Get-ASAppService –SiteName “Default Web Site” –VirtualPath “/SampleApp/SampleService.xamlx” | Clear-ASAppServiceMetadata
2011-12-05