-
Couldn't load subscription status.
- Fork 0
PowerShell
nanakira edited this page Jan 8, 2017
·
5 revisions
PowerShell で Profile を利用して スクリプトの自動読み込みをしてみよう
> echo $profileが、これは CurrentUserCurrentHost のもの。
PowerShell.exe と PowerShell_ise.exe に共通で適用するには CurrentUserAllHosts に適用される、profile.ps1 に記載する。
管理者権限で
> Set-ExecutionPolicy -ExecutionPolicy RemoteSignedif (-not(Test-Path $profile.CurrentUserAllHosts))
{
New-Item -Path $profile.CurrentUserAllHosts -ItemType file
}で profile.ps1 が作成される。
> . $profileC:\Users(UserName)\Documents\WindowsPowerShell\Microsoft.PowerShell_profile.ps1 に
Set-Alias subl "C:\Program Files\Sublime Text 3\sublime_text.exe"> aliasGet-Alias curl$profile に下記追加
del alias:curl
del alias:wget$profile に
$temp = "C:\temp"> cd /> Clear-Hostor
> cls