So i have this simple function that return my current script location:
function Get-CurrentDir
{
$MyInvocation.MyCommand.Path
}
And i want to print this, so i try from PowerShell ISE after the function declaration:
Write-Host $(Get-CurrentDir)
Write-Host (Get-CurrentDir)
Write-Host Get-CurrentDir
And this is my output:
Write-Host $(Get-CurrentDir) --> Write-Host $(Get-CurrentDir)
Write-Host (Get-CurrentDir) --> Write-Host (Get-CurrentDir)
Write-Host Get-CurrentDir --> Write-Host Get-CurrentDir
What i am doing wrong ?