-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #4 from oliverlabs/post-tags
Post tags
- Loading branch information
Showing
5 changed files
with
79 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
--- | ||
title: 'Sudo for Windows' | ||
date: '2024-02-09T10:59:09Z' | ||
draft: false | ||
tags: | ||
- Windows | ||
- Sudo | ||
- PowerShell | ||
--- | ||
|
||
Wow. Sudo for Windows is here! | ||
|
||
See the official announcement in a Microsoft Devblogs [here](https://devblogs.microsoft.com/commandline/introducing-sudo-for-windows/). | ||
|
||
Sudo for Windows is a new way for users to run elevated commands directly from an unelevated console session. It is an ergonomic and familiar solution for users who want to elevate a command without having to first open a new elevated console. | ||
|
||
I gave it a try, and it seems to be doing what it says on the tin. | ||
|
||
Once enabled in Windows System Settings (_For Developers_ Section) like so: | ||
|
||
![Windows System Settings](/img/for-developers-settings2.png) | ||
|
||
When elevating a process from the command-line with sudo, a UAC dialog will appear asking the user to confirm the elevation: | ||
|
||
![UAC Dialog](/img/uac-dialog.png) | ||
|
||
If you are curious how this thing works, here is a diagram from the official announcement: | ||
|
||
![Sudo for Windows Diagram](/img/sudo-diagram.png) | ||
|
||
And here's how you invoke it: | ||
|
||
```powershell | ||
sudo choco upgrade python | ||
``` | ||
|
||
Overall, I am sure the sudo will save some clicks to the users and make the Windows command-line experience more enjoyable. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
{{- $scratch := newScratch }} | ||
|
||
{{- if not .Date.IsZero -}} | ||
{{- $scratch.Add "meta" (slice (printf "<span title='%s'>%s</span>" (.Date) (.Date | time.Format (default "January 2, 2006" site.Params.DateFormat)))) }} | ||
{{- end }} | ||
|
||
{{- if (.Param "ShowReadingTime") -}} | ||
{{- $scratch.Add "meta" (slice (i18n "read_time" .ReadingTime | default (printf "%d min" .ReadingTime))) }} | ||
{{- end }} | ||
|
||
{{- if (.Param "ShowWordCount") -}} | ||
{{- $scratch.Add "meta" (slice (i18n "words" .WordCount | default (printf "%d words" .WordCount))) }} | ||
{{- end }} | ||
|
||
{{- if (.Param "ShowAuthor") -}} | ||
<span class="meta-item"> | ||
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" stroke="black" stroke-width="1" | ||
fill="none" stroke-linecap="round" stroke-linejoin="round"> | ||
<path stroke="none" d="M0 0h24v24H0z" fill="none"></path> | ||
<circle cx="12" cy="7" r="4"></circle> | ||
<path d="M6 21v-2a4 4 0 0 1 4 -4h4a4 4 0 0 1 4 4v2"></path> | ||
</svg> | ||
{{- partial "author.html" . -}}</span> | ||
{{- end }} | ||
|
||
{{- if .Params.tags -}} | ||
<span class="meta-item"> | ||
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" | ||
stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-tag meta-icon" | ||
style="user-select: text;"> | ||
<path d="M20.59 13.41l-7.17 7.17a2 2 0 0 1-2.83 0L2 12V2h10l8.59 8.59a2 2 0 0 1 0 2.82z" style="user-select: text;"> | ||
</path> | ||
<line x1="7" y1="7" x2="7" y2="7" style="user-select: text;"></line> | ||
</svg> | ||
<span class="post-tags"> | ||
{{- range ($.GetTerms "tags") -}} | ||
<a href="{{ .Permalink }}">{{ .LinkTitle }}</a> | ||
{{- end -}} | ||
</span></span> | ||
{{- end }} | ||
|
||
{{- delimit . " · " -}} |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.