I am using the following PowerShell code and I need to check its extension in an if condition
foreach ($line in $lines) {
    $extn = $line.Split("{.}")[1]
    if ($extn -eq "xml" )
    {
    }
}
Is there a straightforward way to check string extensions in PowerShell script in case of strings?
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With