Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $global:SUB = "101010"
- function Get-Serv {
- $PIC = New-Object System.Collections.ArrayList
- $PIC.Clear()
- $PIC.Add("\\SERVER\PIC")
- $i=2
- Do {
- $PIC.Add("\\SERVER\PIC"+"_"+$i++)
- }
- Until ((Test-Path $PIC[-1]) -eq $false)
- $PIC.RemoveAt($PIC.Count -1)
- Find-SUB $PIC
- }
- function Find-SUB ([String[]]$list){
- $subloc = New-Object System.Collections.ArrayList
- $subloc.Clear()
- foreach ($l in $list){
- $c = -Join ( $l,"\",$SUB )
- $w = Test-Path $c
- if ( ( $w ) -eq $true ){
- $subloc.Add( $c )}
- }
- $subloc
- }
- Get-Serv
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement