Welcome to my Code Snippets

MyCodeSnippets.Space

get environment variable

ReAdABLE Source (What is the ReAdABLE Human Format?)

http://mycodesnippets.space/redlang/get-env.red

Demo

Type in red-lang console:

do read http://mycodesnippets.space/redlang/src/get-env.red

https://i.imgur.com/YqeuqIo.png

Code Snippet


Red [
    Title: "get-env.red"
    Description: {
        Get USERNAME to call notepad to edit Powershell Profile
    }
]

powershell.profile: function [][
	username: get-env "username"
	call/show rejoin [{notepad.exe C:\Users\} username {\Documents\WindowsPowerShell\Microsoft.PowerShell_profile.ps1}]
]
powershell-profile: :powershell.profile

print {
    type in red console:
    powershell.profile
    or
    powershell-profile
}