Page tree

Welcome to FreeSoftwareServers Confluence Wiki

Skip to end of metadata
Go to start of metadata

https://ss64.com/ps/syntax-wildcards.html

https://stackoverflow.com/questions/13126175/get-full-path-of-the-files-in-powershell

$FILEPATH = C:\tmp\tes*.txt
$FILEPATH="C:\tmp\test.docx"
$FILEPATH = Get-ChildItem $FILEPATH | % { $_.FullName }
[System.IO.Path]::GetFileNameWithoutExtension($FILEPATH)
[System.IO.Path]::GetExtension($FILEPATH)
$FilePathWithQuotes = '"{0}"' -f $FilePath

The four types of Wildcard:

The * wildcard will match zero or more characters

The ? wildcard will match a single character

[m-n] Match a range of characters from m to n, so [f-m]ake will match fake/jake/make

[abc] Match a set of characters a,b,c.., so [fm]ake will match fake/make

  • No labels