Folder path of a PowerShell file in PowerShell August 6, 2023 by Tarik Try this command in your script: Split-Path -parent $MyInvocation.MyCommand.Definition