Sander Tuulik AK41: Difference between revisions
From ICO wiki
Jump to navigationJump to search
Created page with ' <source lang="powershell"> $op_file = $args[0] if (! $op_file) { Write-Host $op_file = Read-Host "Millisest kataloogist otsida samanimelisi faile?" } Write-Host "Samanimelisi fa…' |
No edit summary |
||
Line 1: | Line 1: | ||
<source lang="powershell"> | <source lang="powershell"> | ||
$ | $kaust = $args[0] | ||
if (! $ | if (! $kaust) { | ||
Write-Host | Write-Host | ||
$ | $kaust = Read-Host "Millisest kataloogist otsida samanimelisi faile?" | ||
} | } | ||
Write-Host "Samanimelisi faile otsiti kataloogist: $ | Write-Host "Samanimelisi faile otsiti kataloogist: $kaust" | ||
$Dir = get-childitem $ | $Dir = get-childitem $kaust -recurse | ||
$List = $Dir | $List = $Dir | ||
$dir1 = $list | group | ? {$_.count -gt 1}| % {$_.group} | $dir1 = $list | group | ? {$_.count -gt 1}| % {$_.group} | ||
echo "" | echo "" | ||
if(!$dir1){Write-Host "Samanimelisi faile polnud kataloogis: $ | if(!$dir1){Write-Host "Samanimelisi faile polnud kataloogis: $kaust"} | ||
$dir1 | format-table -a fullname | $dir1 | format-table -a fullname | ||
</source> | </source> |
Revision as of 09:41, 28 January 2011
$kaust = $args[0]
if (! $kaust) {
Write-Host
$kaust = Read-Host "Millisest kataloogist otsida samanimelisi faile?"
}
Write-Host "Samanimelisi faile otsiti kataloogist: $kaust"
$Dir = get-childitem $kaust -recurse
$List = $Dir
$dir1 = $list | group | ? {$_.count -gt 1}| % {$_.group}
echo ""
if(!$dir1){Write-Host "Samanimelisi faile polnud kataloogis: $kaust"}
$dir1 | format-table -a fullname