GetUniq
function GetUniq{
param($var,$sep)
$erroractionpreference = 'SilentlyContinue'
$ici = (get-location).path
if(!$here){$here = $env:TEMP}
set-location $here
$arrUniq = @()
if($sep -and ($var -match $sep)){$arr = $var.split($sep)}else{$arr = $var}
$arr | ForEach-Object{$arrUniq[$_] = $null}
$result = $arrUniq.keys -join $sep
set-location $ici
return $result
}
GetUniq -var <variable où retirer les doublons> -sep <le séparateur>
/image%2F0881799%2F20140610%2Fob_a8c7fe_logo2.jpg)
Commenter cet article