On Linux, I want to replace a bash script with powershell. The script needs to test a file to determine if it is a symbolic link. In bash, one can use the -L
operator:
if [[ -L "/tmp/mysteryfile" ]] ; then ; echo "It is a link" ; fi
How can I do the same in powershell on Linux?
On my Ubuntu 19.04 this:
yields
So the Mode
l
denotes a link, as does the AttributeReparsePoint
denote a SymbolicLink.But only the LinkType differentiates between Hard-/SymbolicLinks
or
To see some stats: