Trouble executing command from alias [duplicate]










0
















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?










share|improve this question













marked as duplicate by mklement0 powershell
Users with the  powershell badge can single-handedly close powershell questions as duplicates and reopen them as needed.

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 use Notepad $PROFILE no need for Start-Process of defining the location yourself

    – Owain Esau
    Nov 16 '18 at 2:45
















0
















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?










share|improve this question













marked as duplicate by mklement0 powershell
Users with the  powershell badge can single-handedly close powershell questions as duplicates and reopen them as needed.

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 use Notepad $PROFILE no need for Start-Process of defining the location yourself

    – Owain Esau
    Nov 16 '18 at 2:45














0












0








0


1







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?










share|improve this question















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






share|improve this question













share|improve this question











share|improve this question




share|improve this question










asked Nov 16 '18 at 2:28









SamSam

1




1




marked as duplicate by mklement0 powershell
Users with the  powershell badge can single-handedly close powershell questions as duplicates and reopen them as needed.

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 powershell
Users with the  powershell badge can single-handedly close powershell questions as duplicates and reopen them as needed.

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 use Notepad $PROFILE no need for Start-Process of defining the location yourself

    – Owain Esau
    Nov 16 '18 at 2:45













  • 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








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













0






active

oldest

votes

















0






active

oldest

votes








0






active

oldest

votes









active

oldest

votes






active

oldest

votes

Popular posts from this blog

Top Tejano songwriter Luis Silva dead of heart attack at 64

ReactJS Fetched API data displays live - need Data displayed static

政党