lagrey.blogg.se

Microsoft sysinternals
Microsoft sysinternals













New-PSDrive -Name Mod -Root ($env:PSModulePath -split ' ') ` Description "Folder for profile backups. New-variable -name backupHome -value "$doc\WindowsPowerShell\profileBackup" ` New-Variable -Name doc -Value "$home\documents" ` Set-Alias -Name gev -Value Get-EnumValues | out-null Set-Alias -Name rifc -Value Replace-InvalidFileCharacters | out-null Set-Alias -Name gwp -Value Get-WebPage | out-null Set-Alias -Name gfl -Value Get-ForwardLink | out-null Set-Alias -Name tch -Value Test-ConsoleHost | out-null

microsoft sysinternals

Set-Alias -Name ep -Value edit-profile | out-null # NOTES: contains five types of things: aliases, functions, psdrives, Now my Windows PowerShell profile looks like this: I say OK, and then my elevated Windows PowerShell prompt appears. Hmmm, maybe it knows something I don’t know). I then type sudo at the Windows PowerShell prompt, and the UAC prompt appears (strangely enough, it asks about allowing the program to make changes to my system. Set-Alias -Name sudo -Value Start-ElevatedPowerShell | out-nullĪfter I save my function and alias to my Windows PowerShell profile, I close my Windows PowerShell shell, and then open it again. So, I decided to call my function Start-ElevatedPowerShell and then I create an alias named sudo: In the *nix world, such a function is known as sudo. Making an “admin” shortcut is as simple as checking Run as Administrator. The corollary to that is, "How do I elevate Windows PowerShell if I need to do so without having to create a second “admin” shortcut that automatically launches with Admin rights?" The following image shows the Advanced Properties window of the shortcut.

microsoft sysinternals

Yesterday, I wrote a function that changes the title bar of my Windows PowerShell console based on whether the user is elevated (see Use Function to Determine Elevation of PowerShell Console). One of the questions that I get on a fairly regular basis has to do with working with Windows PowerShell as a non-elevated user. One of the great things that I love about the Windows PowerShell community is the interaction I have with them at user groups, conferences, and community events (such as the Atlanta TechStravaganza that is coming up). One of the things we talked about was the importance of community, and how the Windows PowerShell community seems to be really engaged with the Windows PowerShell team and with other documentation efforts. Today I had a great talk with Steve, the Scripting Manager. Microsoft Scripting Guy, Ed Wilson, is here. Summary : Ed Wilson, Microsoft Scripting Guy, talks about launching an elevated Windows PowerShell shell.















Microsoft sysinternals