it:ad:powershell:howto:snippets:work_with_filenames

IT:AD:Powershell:HowTo:Snippets:Work with FileNames

To get just the filename, without Extension:

function Get-FileName-WithoutExtension([string]$fileName){
  #invoke the .NET object to do the heavy lifting:
  $result = [System.IO.Path]:: GetFileNameWithoutExtension($fileName)
}

  • /home/skysigal/public_html/data/pages/it/ad/powershell/howto/snippets/work_with_filenames.txt
  • Last modified: 2023/11/04 23:20
  • by 127.0.0.1