Trouble executing command from alias [duplicate]
This question already has an answer here:
Equivalent to Bash alias in PowerShell
2 answers
How can I write a PowerShell alias with arguments in the middle?
4 answers
I want to create a shortcut for opening my users' profile.ps1 file in notepad from powershell. I can execute the command "Start-Process notepad $SaveAl" without issue and the file opens down at the bottom, but when I try to reference that command in my 'sval' alias, it doesn't recognize the path.
I've tried replacing $SaveAl with the full path it points to but the outcome is identical to the error I get.
Worst case I can just pin the folder to taskbar/quick access but it comes in handy when I'm working within powershell.
Is there something about aliases I'm not understanding?
powershell alias
marked as duplicate by mklement0
StackExchange.ready(function()
if (StackExchange.options.isMobile) return;
$('.dupe-hammer-message-hover:not(.hover-bound)').each(function()
var $hover = $(this).addClass('hover-bound'),
$msg = $hover.siblings('.dupe-hammer-message');
$hover.hover(
function()
$hover.showInfoMessage('',
messageElement: $msg.clone().show(),
transient: false,
position: my: 'bottom left', at: 'top center', offsetTop: -7 ,
dismissable: false,
relativeToBody: true
);
,
function()
StackExchange.helpers.removeMessages();
);
);
);
Nov 16 '18 at 3:50
This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.
add a comment |
This question already has an answer here:
Equivalent to Bash alias in PowerShell
2 answers
How can I write a PowerShell alias with arguments in the middle?
4 answers
I want to create a shortcut for opening my users' profile.ps1 file in notepad from powershell. I can execute the command "Start-Process notepad $SaveAl" without issue and the file opens down at the bottom, but when I try to reference that command in my 'sval' alias, it doesn't recognize the path.
I've tried replacing $SaveAl with the full path it points to but the outcome is identical to the error I get.
Worst case I can just pin the folder to taskbar/quick access but it comes in handy when I'm working within powershell.
Is there something about aliases I'm not understanding?
powershell alias
marked as duplicate by mklement0
StackExchange.ready(function()
if (StackExchange.options.isMobile) return;
$('.dupe-hammer-message-hover:not(.hover-bound)').each(function()
var $hover = $(this).addClass('hover-bound'),
$msg = $hover.siblings('.dupe-hammer-message');
$hover.hover(
function()
$hover.showInfoMessage('',
messageElement: $msg.clone().show(),
transient: false,
position: my: 'bottom left', at: 'top center', offsetTop: -7 ,
dismissable: false,
relativeToBody: true
);
,
function()
StackExchange.helpers.removeMessages();
);
);
);
Nov 16 '18 at 3:50
This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.
1
Alias is reference to the command, but not to the command and arguments.
– PetSerAl
Nov 16 '18 at 2:37
You can useNotepad $PROFILE
no need for Start-Process of defining the location yourself
– Owain Esau
Nov 16 '18 at 2:45
add a comment |
This question already has an answer here:
Equivalent to Bash alias in PowerShell
2 answers
How can I write a PowerShell alias with arguments in the middle?
4 answers
I want to create a shortcut for opening my users' profile.ps1 file in notepad from powershell. I can execute the command "Start-Process notepad $SaveAl" without issue and the file opens down at the bottom, but when I try to reference that command in my 'sval' alias, it doesn't recognize the path.
I've tried replacing $SaveAl with the full path it points to but the outcome is identical to the error I get.
Worst case I can just pin the folder to taskbar/quick access but it comes in handy when I'm working within powershell.
Is there something about aliases I'm not understanding?
powershell alias
This question already has an answer here:
Equivalent to Bash alias in PowerShell
2 answers
How can I write a PowerShell alias with arguments in the middle?
4 answers
I want to create a shortcut for opening my users' profile.ps1 file in notepad from powershell. I can execute the command "Start-Process notepad $SaveAl" without issue and the file opens down at the bottom, but when I try to reference that command in my 'sval' alias, it doesn't recognize the path.
I've tried replacing $SaveAl with the full path it points to but the outcome is identical to the error I get.
Worst case I can just pin the folder to taskbar/quick access but it comes in handy when I'm working within powershell.
Is there something about aliases I'm not understanding?
This question already has an answer here:
Equivalent to Bash alias in PowerShell
2 answers
How can I write a PowerShell alias with arguments in the middle?
4 answers
powershell alias
powershell alias
asked Nov 16 '18 at 2:28
SamSam
1
1
marked as duplicate by mklement0
StackExchange.ready(function()
if (StackExchange.options.isMobile) return;
$('.dupe-hammer-message-hover:not(.hover-bound)').each(function()
var $hover = $(this).addClass('hover-bound'),
$msg = $hover.siblings('.dupe-hammer-message');
$hover.hover(
function()
$hover.showInfoMessage('',
messageElement: $msg.clone().show(),
transient: false,
position: my: 'bottom left', at: 'top center', offsetTop: -7 ,
dismissable: false,
relativeToBody: true
);
,
function()
StackExchange.helpers.removeMessages();
);
);
);
Nov 16 '18 at 3:50
This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.
marked as duplicate by mklement0
StackExchange.ready(function()
if (StackExchange.options.isMobile) return;
$('.dupe-hammer-message-hover:not(.hover-bound)').each(function()
var $hover = $(this).addClass('hover-bound'),
$msg = $hover.siblings('.dupe-hammer-message');
$hover.hover(
function()
$hover.showInfoMessage('',
messageElement: $msg.clone().show(),
transient: false,
position: my: 'bottom left', at: 'top center', offsetTop: -7 ,
dismissable: false,
relativeToBody: true
);
,
function()
StackExchange.helpers.removeMessages();
);
);
);
Nov 16 '18 at 3:50
This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.
1
Alias is reference to the command, but not to the command and arguments.
– PetSerAl
Nov 16 '18 at 2:37
You can useNotepad $PROFILE
no need for Start-Process of defining the location yourself
– Owain Esau
Nov 16 '18 at 2:45
add a comment |
1
Alias is reference to the command, but not to the command and arguments.
– PetSerAl
Nov 16 '18 at 2:37
You can useNotepad $PROFILE
no need for Start-Process of defining the location yourself
– Owain Esau
Nov 16 '18 at 2:45
1
1
Alias is reference to the command, but not to the command and arguments.
– PetSerAl
Nov 16 '18 at 2:37
Alias is reference to the command, but not to the command and arguments.
– PetSerAl
Nov 16 '18 at 2:37
You can use
Notepad $PROFILE
no need for Start-Process of defining the location yourself– Owain Esau
Nov 16 '18 at 2:45
You can use
Notepad $PROFILE
no need for Start-Process of defining the location yourself– Owain Esau
Nov 16 '18 at 2:45
add a comment |
0
active
oldest
votes
0
active
oldest
votes
0
active
oldest
votes
active
oldest
votes
active
oldest
votes
1
Alias is reference to the command, but not to the command and arguments.
– PetSerAl
Nov 16 '18 at 2:37
You can use
Notepad $PROFILE
no need for Start-Process of defining the location yourself– Owain Esau
Nov 16 '18 at 2:45