You can use the automatic variable $PSScriptRoot anytime a script is running.
If you want to see the output, just
Write-Host $PSScriptRoot
Or $MyInvocation.PSScriptRoot , that will have information about the calling script and not the current script
Additional information about all the automatic variables is available on Learn:
https://learn.microsoft.com/en-us/powershell/module/microsoft.powershell.core/about/about_automatic_variables?view=powershell-7.3