-
-
Save irwins/d452431d678d93adde0a8372c9a091ab to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<# | |
Author: I. Strachan | |
Version: | |
Version History: | |
Purpose: OVF DFS links & targets | |
#> | |
Param( | |
$csvFile = 'DFSnLinksTargets.csv' | |
) | |
Import-Module DFSN -Verbose:$false | |
#region Import CSV and saved Credentials | |
$csvDFSnTargets = Import-Csv -Path .\sources\csv\$($csvFile) -Delimiter "`t" -Encoding UTF8 | |
$DfsnLinkTargets = Get-DfsnRoot | | |
ForEach-Object{ | |
Get-DfsnFolder -Path "$($_.Path)\*" | | |
Get-DfsnFolderTarget | | |
Select-Object Path,TargetPath | |
} | |
#endregion | |
$lookupDFSn = $DfsnLinkTargets | Group-Object -AsHashTable -AsString -Property Path | |
#region Main | |
$csvDFSnTargets | | |
ForEach-Object{ | |
Describe "DFSn Link & Target Operation validation share $($_.Link)" -Tags 'DFSnLinkTargets' { | |
Context "Verifying DFS Link $($_.Link)" { | |
It "DFS Link $($_.Link) exists" { | |
$lookupDFSn.$($_.Link).Path | Should be $_.Link | |
} | |
It "DFS Target $($_.Target) exists" { | |
$lookupDFSn.$($_.Link).TargetPath | Should be $_.Target | |
} | |
} | |
} | |
} | |
#endregion |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment