Reputation: 369
SET ML_PATH=E:\Workspace\Handson-ml2
echo $ML_PATH
printed nothing.
echo "ML_PATH = $ML_PATH"
printed just:
ML_PATH =
How could i set a variable in powershell and print the variable like echo of linux?
Upvotes: 1
Views: 527
Reputation: 58931
You can define a variable in PowerShell using the $varname =
syntax:
$ML_PATH = "E:\Workspace\Handson-ml2"
Write-Output $ML_PATH
Note: echo
is an alias for the Write-Output
cmdlet which you can determine using the Get-Alias
cmdlet:
Get-Alias echo
CommandType Name Version Source
----------- ---- ------- ------
Alias echo -> Write-Output
Upvotes: 1