on windows you have drive-letters that are mapped to variable-namespaces and you can use them to acess the content of a file via a variable like this:
${c:\hubba.txt}
Now on linux you don’t have drive-letters but there is a filesystem-provider that provides 2 “drives” (Get-PSDrive tells you asmuch): You have “Temp” and you have “/”.
The Temp-drives works as expected, eg I can do this:
"hubba" > /tmp/hubba.txt
${temp:hubba.txt}
And the second expression above retrieves the content of the file again.
My question is now how does this mechanism work with the “/” drive?
The normal schema would be “<drive-name>:<file-path>”, so I have been experimenting with variations of
${/:/my/file/path}
however that does not work.
So is this feature (to access the content of a file via a variable) available for the “/”-drive on linux and what would be the proper syntax?
Hey @morgon and thanks for posting. I don’t have the answer that you are looking for right now to be honest but I am asking around to people that do. Just wanted to let you know that I saw your post.
I am quite new to powershell and it must be quite a challenge to create a multi-platform scripting language but I have been playing around with it a little and I think it is worth it to invest some time in it for me.
However it is always jarring when you have special cases, so if you have a “/”-drive it should work like the other “drives” - even more so as I find the feature to be quite useful for one-off text-file manipulation.