0
dir -force

shows hidden files.

Is there a way to make dir always show hidden files without the option force?

I tried Set-Alias but this doesn't work

Set-alias -Name la -Value "dir -force"
1

1 Answer 1

3

You have to declare a function, not an alias.

function la {
    Param($path = ".")
    dir $path -Force
}

Put it in your PowerShell Profile to have it loaded by default when you open PowerShell.

You can use this function like this la or la C:\windows or la C:\windows, K:\somewhere

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .