2
1
I have cp for power shell. But I want to use cp in verbose mode without writing -v. So cp should be aliased to "cp -v" command. How to alias cp to "cp -v" in power shell?
2
1
I have cp for power shell. But I want to use cp in verbose mode without writing -v. So cp should be aliased to "cp -v" command. How to alias cp to "cp -v" in power shell?
2
The alias
command will not create parameters. You'll have to delete the existing alias for cp
and use a function:
Remove-Item alias:cp
Function cp { Copy-Item -v @args }
See here.
1
Create a new alias for calling cp with the Verbose
flag:
function Copy-ItemWithVerbose
{
Copy-Item -Verbose @args
}
Set-Alias -Name cpv -Value Copy-ItemWithVerbose
0
in PS3 you can use this:
PS III> $PSDefaultParameterValues.Add("Copy-item:verbose","$true")
PS III> cp
What are you really trying to do? – kinokijuf – 2012-08-28T16:12:46.697
I have cp for power shell. But I want to use cp in verbose mode without writing -v. So cp should be aliased to "cp -v" command. – Narek – 2012-08-28T16:18:54.647