Find-DscResource
Finds Desired State Configuration (DSC) resources.
構文
All
Find-DscResource
[[-Name] <String[]>]
[-ModuleName <String>]
[-MinimumVersion <String>]
[-MaximumVersion <String>]
[-RequiredVersion <String>]
[-AllVersions]
[-AllowPrerelease]
[-Tag <String[]>]
[-Filter <String>]
[-Proxy <Uri>]
[-ProxyCredential <PSCredential>]
[-Repository <String[]>]
[<CommonParameters>]
説明
The Find-DscResource
cmdlet searches registered repositories to find DSC resources contained in
modules. By default Find-DscResource
searches all registered repositories.
This is a proxy cmdlet for the Find-PSResource
cmdlet in the
Microsoft.PowerShell.PSResourceGet. For more information, see
Find-PSResource.
例
Example 1: Find a DSC resource by name
Find-DscResource
locates DSC resources by name. Use commas to separate an array of resource names.
Find-DscResource -Name xWebsite, xWebApplication, xWebSiteDefaults
Name Version ModuleName Repository
---- ------- ---------- ----------
xWebApplication 2.6.0.0 xWebAdministration PSGallery
xWebsite 2.6.0.0 xWebAdministration PSGallery
xWebSiteDefaults 2.6.0.0 xWebAdministration PSGallery
Find-DscResource
uses the Name parameter to find the specified array of DSC resources.
Example 2: Find a DSC resource and install it
Find-DscResource
locates a DSC resource and sends the object down the pipeline to be installed.
After the installation, use Get-InstalledModule
to view the results.
Multiple resources from the same module can be sent down the pipeline to the Install-Module
.
Install-Module
attempts to only install the module once.
Find-DscResource -Name xWebsite | Install-Module
Find-DscResource
uses the Name parameter to find the resource named xWebsite. The object
is sent down the pipeline to the Install-Module
cmdlet. Install-Module
installs the
xWebAdministration module for the resource.
パラメーター
-AllowPrerelease
Includes resources marked as a prerelease in the results.
The proxy cmdlet maps this parameter to the Prerelease parameter of Find-PSResource
.
パラメーターのプロパティ
型: | SwitchParameter |
規定値: | None |
ワイルドカードのサポート: | False |
DontShow: | False |
パラメーター セット
(All)
配置: | Named |
必須: | False |
パイプラインからの値: | False |
プロパティ名別のパイプラインからの値: | False |
残りの引数からの値: | False |
-AllVersions
The proxy cmdlet ignores this parameter since it's not supported by the DscResourceNameParameterSet
of Find-PSResource
.
パラメーターのプロパティ
型: | SwitchParameter |
規定値: | None |
ワイルドカードのサポート: | False |
DontShow: | False |
パラメーター セット
(All)
配置: | Named |
必須: | False |
パイプラインからの値: | False |
プロパティ名別のパイプラインからの値: | False |
残りの引数からの値: | False |
-Filter
The proxy cmdlet ignores this parameter since it's not supported by the DscResourceNameParameterSet
of Find-PSResource
.
パラメーターのプロパティ
型: | String |
規定値: | None |
ワイルドカードのサポート: | False |
DontShow: | False |
パラメーター セット
(All)
配置: | Named |
必須: | False |
パイプラインからの値: | False |
プロパティ名別のパイプラインからの値: | False |
残りの引数からの値: | False |
-MaximumVersion
The proxy cmdlet ignores this parameter since it's not supported by the DscResourceNameParameterSet
of Find-PSResource
.
パラメーターのプロパティ
型: | String |
規定値: | None |
ワイルドカードのサポート: | False |
DontShow: | False |
パラメーター セット
(All)
配置: | Named |
必須: | False |
パイプラインからの値: | False |
プロパティ名別のパイプラインからの値: | False |
残りの引数からの値: | False |
-MinimumVersion
The proxy cmdlet ignores this parameter since it's not supported by the DscResourceNameParameterSet
of Find-PSResource
.
パラメーターのプロパティ
型: | String |
規定値: | None |
ワイルドカードのサポート: | False |
DontShow: | False |
パラメーター セット
(All)
配置: | Named |
必須: | False |
パイプラインからの値: | False |
プロパティ名別のパイプラインからの値: | False |
残りの引数からの値: | False |
-ModuleName
The proxy cmdlet ignores this parameter since it's not supported by the DscResourceNameParameterSet
of Find-PSResource
.
パラメーターのプロパティ
型: | String |
規定値: | None |
ワイルドカードのサポート: | False |
DontShow: | False |
パラメーター セット
(All)
配置: | Named |
必須: | False |
パイプラインからの値: | False |
プロパティ名別のパイプラインからの値: | False |
残りの引数からの値: | False |
-Name
Specifies the name of a resource. The default is all resources. Use commas to separate an array of resource names.
The proxy cmdlet maps this parameter to the DscResourceName parameter of Find-PSResource
.
パラメーターのプロパティ
型: | String[] |
規定値: | None |
ワイルドカードのサポート: | False |
DontShow: | False |
パラメーター セット
(All)
配置: | 0 |
必須: | False |
パイプラインからの値: | False |
プロパティ名別のパイプラインからの値: | False |
残りの引数からの値: | False |
-Proxy
The proxy cmdlet ignores this parameter since it's not supported by the DscResourceNameParameterSet
of Find-PSResource
.
パラメーターのプロパティ
型: | Uri |
規定値: | None |
ワイルドカードのサポート: | False |
DontShow: | False |
パラメーター セット
(All)
配置: | Named |
必須: | False |
パイプラインからの値: | False |
プロパティ名別のパイプラインからの値: | True |
残りの引数からの値: | False |
-ProxyCredential
The proxy cmdlet ignores this parameter since it's not supported by the DscResourceNameParameterSet
of Find-PSResource
.
パラメーターのプロパティ
型: | PSCredential |
規定値: | None |
ワイルドカードのサポート: | False |
DontShow: | False |
パラメーター セット
(All)
配置: | Named |
必須: | False |
パイプラインからの値: | False |
プロパティ名別のパイプラインからの値: | True |
残りの引数からの値: | False |
-Repository
Specifies a repository to search for resources. Use commas to separate an array of repository names.
パラメーターのプロパティ
型: | String[] |
規定値: | None |
ワイルドカードのサポート: | False |
DontShow: | False |
パラメーター セット
(All)
配置: | Named |
必須: | False |
パイプラインからの値: | False |
プロパティ名別のパイプラインからの値: | False |
残りの引数からの値: | False |
-RequiredVersion
The proxy cmdlet ignores this parameter since it's not supported by the DscResourceNameParameterSet
of Find-PSResource
.
パラメーターのプロパティ
型: | String |
規定値: | None |
ワイルドカードのサポート: | False |
DontShow: | False |
パラメーター セット
(All)
配置: | Named |
必須: | False |
パイプラインからの値: | False |
プロパティ名別のパイプラインからの値: | False |
残りの引数からの値: | False |
-Tag
The proxy cmdlet ignores this parameter since it's not supported by the DscResourceNameParameterSet
of Find-PSResource
.
パラメーターのプロパティ
型: | String[] |
規定値: | None |
ワイルドカードのサポート: | False |
DontShow: | False |
パラメーター セット
(All)
配置: | Named |
必須: | False |
パイプラインからの値: | False |
プロパティ名別のパイプラインからの値: | False |
残りの引数からの値: | False |
CommonParameters
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutBuffer, -OutVariable, -PipelineVariable, -ProgressAction, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters.
出力
PSGetDscResourceInfo
Find-DscResource
returns a PSGetDscResourceInfo object.
メモ
The PowerShell Gallery no longer supports Transport Layer Security (TLS) versions 1.0 and 1.1. You must use TLS 1.2 or higher. Use the following command to ensure you are using TLS 1.2:
[Net.ServicePointManager]::SecurityProtocol = [Net.ServicePointManager]::SecurityProtocol -bor [Net.SecurityProtocolType]::Tls12