vendredi 26 février 2021

Powershell to find folder/subfolder and then write if condition to perform action only if folder A is greater than folder B

Basically need to write powershell which give me list of sub directory's. in my sub directory my folder structure is like 101.10.1 , 101.10.2 , 101.10.3 now want to write if condition which take a higher directory from folder (101.10.3) and rhen remove ms sql 2005 application.

something like this

    ****$path = "C:\abc\xyzh\Versions"
$contents = Get-ChildItem -Path $path | sort | Select-Object -Last 10
$contents.Name
$condition = $contents.Name
if ( $condition -gt "$path/$condition" )
{
        # do something"
    }****

Aucun commentaire:

Enregistrer un commentaire