HELP! I'm trying to figure out a way to get an alias of PATH (like in linux) but I'm coming up with this ps error:
**PS C:\Users\Alex> $env:Path**
C:\Program Files\Microsoft\jdk-11.0.16.101-hotspot\bin;C:\Program Files (x86)\VMware\VMware Workstation\bin\;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Windows\System32\OpenSSH\;C:\Program Files (x86)\NVIDIA Corporation\PhysX\Common;C:\Program Files\Microsoft SQL Server\150\Tools\Binn\;C:\Program Files\Microsoft SQL Server\Client SDK\ODBC\170\Tools\Binn\;C:\Program Files\dotnet\;C:\Program Files (x86)\Windows Kits\10\Windows Performance Toolkit\;C:\Users\Alex\AppData\Local\Microsoft\WindowsApps;C:\Users\Alex\AppData\Local\Programs\Microsoft VS Code\bin;C:\Users\Alex\.dotnet\tools
**PS C:\Users\Alex> $env:Path -split(";")**
C:\Program Files\Microsoft\jdk-11.0.16.101-hotspot\bin
C:\Program Files (x86)\VMware\VMware Workstation\bin\
C:\Windows\system32
C:\Windows
C:\Windows\System32\Wbem
C:\Windows\System32\WindowsPowerShell\v1.0\
C:\Windows\System32\OpenSSH\
C:\Program Files (x86)\NVIDIA Corporation\PhysX\Common
C:\Program Files\Microsoft SQL Server\150\Tools\Binn\
C:\Program Files\Microsoft SQL Server\Client SDK\ODBC\170\Tools\Binn\
C:\Program Files\dotnet\
C:\Program Files (x86)\Windows Kits\10\Windows Performance Toolkit\
C:\Users\Alex\AppData\Local\Microsoft\WindowsApps
C:\Users\Alex\AppData\Local\Programs\Microsoft VS Code\bin
C:\Users\Alex\.dotnet\tools
**PS C:\Users\Alex> set-alias -Name PATH -Value $env:Path -split(";")**
Set-Alias : A parameter cannot be found that matches parameter name 'split'.
At line:1 char:39
+ set-alias -Name PATH -Value $env:Path -split(";")
+ ~~~~~~
+ CategoryInfo : InvalidArgument: (:) [Set-Alias], ParameterBindingException
+ FullyQualifiedErrorId : NamedParameterNotFound,Microsoft.PowerShell.Commands.SetAliasComm
and
PS C:\Users\Alex>
I have tried to wrap $env:Path -split(";") in quotes but it gives me another error:
**PS C:\Users\Alex> set-alias -Name PATH -Value "$env:Path -split(";")"
)**
**PS C:\Users\Alex> PATH**
PATH : The term 'C:\Program Files\Microsoft\jdk-11.0.16.101-hotspot\bin;C:\Program Files
(x86)\VMware\VMware Workstation\bin\;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\
Windows\System32\WindowsPowerShell\v1.0\;C:\Windows\System32\OpenSSH\;C:\Program Files
(x86)\NVIDIA Corporation\PhysX\Common;C:\Program Files\Microsoft SQL
Server\150\Tools\Binn\;C:\Program Files\Microsoft SQL Server\Client
SDK\ODBC\170\Tools\Binn\;C:\Program Files\dotnet\;C:\Program Files (x86)\Windows
Kits\10\Windows Performance Toolkit\;C:\Users\Alex\AppData\Local\Microsoft\WindowsApps;C:\Users\
Alex\AppData\Local\Programs\Microsoft VS Code\bin;C:\Users\Alex\.dotnet\tools -split(' is not
recognized as the name of a cmdlet, function, script file, or operable program. Check the
spelling of the name, or if a path was included, verify that the path is correct and try again.
At line:1 char:1
+ PATH
+ ~~~~
+ CategoryInfo : ObjectNotFound: (C:\Program File...t\tools -split(:String) [], Co
mmandNotFoundException
+ FullyQualifiedErrorId : CommandNotFoundException