Windows 11 Script returns a System.IO.DirectoryInfo data instead of the string when it should explicitly return the string

  • Thread starter Thread starter WalterNuñez1
  • Start date Start date
W

WalterNuñez1

I have the following script; which option 1 and 2 work correctly, but option 3, in which the user is expected to enter the directory name, does not work... this is my script: function Set-Destination { param ( [string]$dockroot ) $destinationPath = Join-Path -Path $scriptDirectory -ChildPath "/project/$dockroot" if (-not (Test-Path -Path $destinationPath -PathType Container)) { New-Item -Path $destinationPath -ItemType Directory } } function Get-DirectoryRoot { Write-Host "`n Set your DocumentRoot directory." -ForegroundColor "Red" Write-Host " Y

Continue reading...
 
Back
Top