Need to create Powershell Profile and Every time start it should ask to load profile Y or N. it should load only when i type Y.
Can someone help me!
Need to create Powershell Profile and Every time start it should ask to load profile Y or N. it should load only when i type Y.
Can someone help me!
To follow-up, Please let us know if you have further query on this.
Please don’t forget to Accept the answer
Hi @vinayvernekar-4559
Please refer the settings on the below url.
How To Create PowerShell Profile Step by Step with Examples
If the Answer is helpful, please click Accept Answer
and up-vote, this can be beneficial to other community members.
Hi,
Try adding this to your profile:
$input=Read-Host -Prompt 'Do you want to load the profile?'
if($input -eq 'Y'){
#contents of the profile
}
This cannot stop the profile from being loaded but it makes powershell load nothing from the profile if you don't type Y.
Best Regards,
Ian Xue
============================================
If the Answer is helpful, please click "Accept Answer" and upvote it.
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.
8 people are following this question.