Add Test-DSCConfigurationDataDeployment function and related enhancements
This commit is contained in:
34
Private/Get-ConfigurationDataSourceFileInfo.ps1
Normal file
34
Private/Get-ConfigurationDataSourceFileInfo.ps1
Normal file
@@ -0,0 +1,34 @@
|
||||
function Get-ConfigurationDataSourceFileInfo {
|
||||
[CmdletBinding()]
|
||||
Param(
|
||||
[Parameter(Mandatory=$true)]
|
||||
[string]
|
||||
$Path,
|
||||
|
||||
[Parameter(Mandatory=$true)]
|
||||
[string]
|
||||
$BasePath,
|
||||
|
||||
[Parameter(Mandatory=$false)]
|
||||
[switch]
|
||||
$UseRelativePath
|
||||
)
|
||||
|
||||
$ResolvedPath = Resolve-ConfigurationDataTemplatePath -Path $Path -BasePath $BasePath
|
||||
$Item = Get-Item -LiteralPath $ResolvedPath
|
||||
$Hash = Get-FileHash -LiteralPath $ResolvedPath -Algorithm SHA256
|
||||
|
||||
$DisplayPath = if($UseRelativePath){
|
||||
ConvertTo-ConfigurationDataRelativePath -Path $ResolvedPath -BasePath $BasePath
|
||||
}else{
|
||||
$ResolvedPath
|
||||
}
|
||||
|
||||
[ordered]@{
|
||||
Path = $DisplayPath
|
||||
Hash = $Hash.Hash
|
||||
Algorithm = $Hash.Algorithm
|
||||
Size = $Item.Length
|
||||
LastWriteTimeUtc = $Item.LastWriteTimeUtc.ToString("o")
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user