# create profile if it does not yet exist $exists = Test-Path-Path$Profile.CurrentUserAllHosts if (!$exists) { $null = New-Item-Path$Profile.CurrentUserAllHosts -ItemType File -Force }
# add code to profile @' $greetings = 'Hello there!', 'Glad to see you!', 'Happy coding!', 'Have a great day!', 'May the PowerShell be with you!' $text = $greetings | Get-Random $null = (New-Object -COM Sapi.SpVoice).Speak($text) '@ | Add-Content-Path$Profile.CurrentUserAllHosts -Encoding Default
$greetings = 'Hello there!', 'Glad to see you!', 'Happy coding!', 'Have a great day!', 'May the PowerShell be with you!'
$greetings | Get-Random
您所需要做的只是将这段代码加到您的 profile 脚本,例如这样:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
# create profile if it does not yet exist $exists = Test-Path-Path$Profile.CurrentUserAllHosts if (!$exists) { $null = New-Item-Path$Profile.CurrentUserAllHosts -ItemType File -Force }
# add code to profile @' $greetings = 'Hello there!', 'Glad to see you!', 'Happy coding!', 'Have a great day!', 'May the PowerShell be with you!' $greetings | Get-Random '@ | Add-Content-Path$Profile.CurrentUserAllHosts -Encoding Default
When you open a native PowerShell console in Windows 10, you can hold down CTRL+SHIFT, then move your mouse wheel, to adjust console background color transparency, and let other windows shine through. The same works for cmd.exe as well, of course. 当您在 Windows 10 中打开一个原生的 PowerShell 控制台,按下 CTRL + SHIFT 键,然后滚动鼠标滚轮,就可以调节控制台背景色的透明度,并且让其它窗口的内容透射出来。当然这对 cmd.exe 也是有效的。
Dateline Standard Time : 18:41h ()
UTC-11 : 19:41h (Coordinated Universal Time-11)
Aleutian Standard Time : 21:41h (Aleutian Islands)
Hawaiian Standard Time : 20:41h (Hawaii)
Marquesas Standard Time : 21:11h (Marquesas Islands)
Alaskan Standard Time : 22:41h (Alaska)
UTC-09 : 21:41h (Coordinated Universal Time-09)
Pacific Standard Time (Mexico) : 23:41h (Baja California)
UTC-08 : 22:41h (Coordinated Universal Time-08)
Pacific Standard Time : 23:41h ()
US Mountain Standard Time : 23:41h (Arizona)
Mountain Standard Time (Mexico): 00:41h (Chihuahua, La Paz, Mazatlan)
Mountain Standard Time : 00:41h ()
Central America Standard Time : 00:41h (Central America)
Central Standard Time : 01:41h ()
Easter Island Standard Time : 01:41h (Easter Island)
Central Standard Time (Mexico) : 01:41h (Guadalajara, Mexico City, Monterrey)
Canada Central Standard Time : 00:41h (Saskatchewan)
SA Pacific Standard Time : 01:41h (Bogota, Lima, Quito, Rio Branco)
Eastern Standard Time (Mexico) : 02:41h (Chetumal)
Eastern Standard Time : 02:41h ()