Masthash

#powershell

12 hours ago

Wow, just stumbled across #nushell while dabbling around in the federated timeline.
This is a really cool looking #shell. I'm thinking I can finally stop being a #PowerShell fanboi (gotta say it's getting a tad embarrassing).
Though I've used #bash, #zsh and #pwsh quite a bit there is a little bit of a learning curve, so I'm stil mucking around and kicking the tyres. But have a look at these error messages. Look at them!

Terminal window showing me mucking around in nushell. There are several errors in my commands, which the shell highlights graphically by underlining the problem and explaining what the error is.
I'd be interested if this kind of graphical markdown makes nushell harder to use if you're reliant on screen readers. If I OCR the readout it garbles it considerably due to all the lines and markings.
Clayton Tyger
1 day ago

Favorite #PowerShell module to help you create your own module? Curious what is everyone favorite these days!

Joel Bennett
2 days ago

Do you have a preference for any of these very verbose #PowerShell views for errors?

I've made the window just a little narrow to see how the line-wrapping affects it, and I'm not totally happy with any of them.

Ariel :verified:
2 days ago

Why can't there be just a "git" installer for windows without the extra crap? Like, nowadays #powershell rocks, so no need for Git Bash. Most (if not all) IDEs and editors include git GUIs, and there are tools like Sourcetree or GH Desktop.

Why do they keep shipping that crap together? So I have to delete the registry entries to remove Git Bash from context menus, and delete the Start Menu icons?

Ed
3 days ago

I managed to get Robot Framework to complete a relatively complex #web #automation #Selenium task inside a #Docker container.

I'm relatively confident that the next integration test I use for my personal website will use Robot Framework. It currently uses #PowerShell #Pester tests, but it's hard to beat the readability of Robot Framework.

mdgrs
3 days ago

2023 Microsoft Build - with the PowerShell PM's:

https://youtu.be/QXxir1KqjNU

Love the positive atmosphere🌟

#PowerShell

Peter Daniels 🟧
3 days ago

@JenMsft, I have #Windows11, dual external monitors, and the latest #Powershell (7.x). Powershell shortcut is on the task bar. Often, when I right click the task bar shortcut and try to run it as another user, it fails. Busy cursor, task bar flashes away and back, and no console

Matthew Dowst
3 days ago

Since I, apparently, forgot to hit the publish button last week, you get a double dose of #PowerShell Weekly today.
https://psweekly.dowst.dev/?p=5802
https://psweekly.dowst.dev/?p=5783

heise Developer
3 days ago

Neu in .NET 7.0 [15]: Docker-Deployment mit .NET CLI ohne Dockerfile

Ein neues NuGet-Paket kümmert sich um die passende Docker-Konfiguration für containerisierte .NET-Anwendungen.

https://www.heise.de/blog/Neu-in-NET-7-0-15-Docker-Deployment-mit-NET-CLI-ohne-Dockerfile-9066836.html?wt_mc=sm.red.ho.mastodon.mastodon.md_beitraege.md_beitraege

#Net #Containerisierung #Docker #PowerShell #news

Clayton Tyger
4 days ago

Call it scope creep or call it a better solution.. Automated 365 test environment blog is turning into a module and blog. Really excited about this! I ❤️#PowerShell

Here's the latest article for my premium #PowerShell subscribers. https://jeffhicks.substack.com/p/getting-your-group-on

Behind the PowerShell Pipeline
Aljoscha Rittner (beandev)
4 days ago

I'm in a call.

A small project with #HomeAssistant and #PowerShell to indicate a running meeting call.

Project can be found on #Codeberg.

https://codeberg.org/beandev/call-detector

#teams #zoom #HomeOffice #WorkFromHome

A Zigbee driven lamp behind a glas door with red light
Tim Nolte
4 days ago

@beandev I'm on #Linux so I might "fork" this and add a shell script to do the same sort of detection as your #PowerShell script. #HomeAssistant #meetings #WorkFromHome

Taggart :donor:
4 days ago

Super freaking handy #PowerShell Module I found today: watch a directory for realtime file creates/changes/deletions: https://github.com/jfromaniello/pswatch

Prinny
5 days ago

Other than going back to #archlinux I've basically poured a lot of time learning #powershell. I can say hands-down PowerShell is one of the most underrated scripting languages. The sheer simplicity once you learn its syntax and flow of things makes it a very versatile tool especially for cross-platform.

To think I could simply start threads so easily to do things with start-threadjob and other things in parallel left me in awed.

I've spent all morning being distracted by shiny #PowerShell things. This now means I have more to write about, assuming I can finish what I was originally going to write about.

If you missed this year's #PowerShell Summit, start making plans for 2024. https://powershell.org/2023/05/powershell-devops-global-summit-2024/

Dr. Strangelove PowerShell Bomb
Chris :donor:
6 days ago

Ich suche (#FediHire) eine/n Mid-Level #Developer, der/die verschiedenste Aufgabenstellungen und Sprachen anfassen kann. Es gibt kleine Scripting- und Software-Projekte in #pyhton, #powershell, #bash, #php, #sql, #javascript, usw. Darüber hinaus brauchen wir häufig API-Connectoren zu Netzwerk- und Security-Produkten, die meist mit #xml (z.B. für SIEM-Themen) und #json (z.B. für Automatisierungen) als Austauschformat nutzen. Fokus-Hersteller sind #ExtremeNetworks und #Fortinet. Interne Tools gibt es u.a. mit #Excel #Macros (#vba / #dotNET). Also wirklich vielfältige größere und kleine Projekte...

Meine Kollegin/Mein Kollege sollte also strukturiert und mit Planung an Projekte herangehen können, anstatt, wie aktuell die Projekte laufen "jede/r, der/die ein bisschen Scripten kann, schreibt irgendwie irgendwas, was niemand anderes mehr brauchbar nutzen kann".

#Vollzeit oder #Teilzeit, #Deutschland (Hauptstandort #Pforzheim), zu großem Prozentsatz #remote möglich.
#Jobs #FediJobs #getFediHired

(Details zur Firma im übergeordneten Toot)

Adam Driscoll
6 days ago

I released an update to the #PowerShell Universal calendar component to support locale and custom event rendering.

https://github.com/ironmansoftware/universal-modules/tree/main/Components/Calendar#powershell-universal-app-calendar

Clayton Tyger
6 days ago

More done on the #PowerShell 365 test environment.. create users, assign licenses, add/remove groups, and add/remove users from groups currently done. All from an excel workbook. Almost there! Blog post and video tutorial.. which would you want to see first?

#codesnippet #powershell #LetsPlayWithCode
Welcher RAM ist eigentlich verbaut? Und wo kann ich den dann kaufen?

$ram = Get-WmiObject -Class Win32_PhysicalMemory
foreach ($module in $ram) {
$partNumber = $module.PartNumber
Write-Host "Modul-Teilenummer: $partNumber"
}

Set-Clipboard $partNumber
$url = "https://geizhals.de/?fs=$partNumber&hloc=de"
Start-Process "msedge.exe" -ArgumentList "--app=$url", "--start-fullscreen"

Ligniform
6 days ago

I've been writing a lot more #PowerShell #Scripts at work. If it didn't work so well with Active Directory I would prefer using #Python or #Bash tbh.
I love automating stuff but damn PowerShell can be a pain 🙃​

Ed Tittel
1 week ago

Picking up and bearing "the burden of history" in #PowerShell turns out to be surprisingly fun. #WindowsInsiders #WIMVP #Windows10 #Windows11 https://www.edtittel.com/blog/deciphering-powershell-history-commands.html

Windows Terminal (PowerShell) session showing command history after a bit of experimental manipulation. Great fun!
Feoh
1 week ago

Kinda excited that fzf (FuzzyFinder) works like a champ on #windows #powershell with PSFzf: https://github.com/kelleyma49/PSFzf

Being able to find any file anywhere with Ctrl-T or change to any directory with Alt+C.

As a command line jockey forever it's a *huge* productivity boost.

Joel Bennett
1 week ago

@ligniform because of that, it's actually the more cross-platform option too, which is amusing 😜

I mean, to successfully call native apps from #PowerShell you sometimes need to use `Convert-Path` -- but in general, using / in paths is much less likely to cause problems running on Windows than using \ on Linux 😒

Joel Bennett
1 week ago

I finally got frustrated enough to want to fix #PowerShell DetailedView for #error so the output is colored for readability, like Get-Error.

To my surprise (and a little frustration), it turns out this view actually just calls Get-Error and deliberately strips the color.

There are side effects, but you CAN avoid this by setting:

$ErrorView = "DetailedView"
$PSStyle.OutputRendering = "Ansi"

I'll have to get in a PR to stop stripping over the weekend.

If you need no color, use $ENV:NO_COLOR

So after saying I'd never write any more books - I got asked to write a chapter on #PowerShell for a Windows 11 book. Chapter submitted - now I await the hell that will be getting!

Kat Moss
2 weeks ago

there are still some software who haven't changed their paradigms as of today; #Ansible is one; #powershell is no longer just a windows technology. We need to see more scripts for other platforms written in it. I intend to eventually practice what I preach. Generically, though, right now, until Ansible changes their stance. I might bug Jordan about that.

Switching to the new cross-platform powershell & I'm seeing these gossamer predictions for what I'm likely to type next. Very cool! But I have no idea how to take advantage of them--hitting tab just does normal command-or-file-in-current-directory completion. Can anybody enlighten me? #Powershell

First thing I do nowadays when I get access to a SQL Server. Add my SQL instances to Registered Servers then:

Get-DbaRegServer | Export-DbaInstance

This will export a bunch of objects including logins, jobs, database backup scripts, sp_configure, server roles, database mail and more #SQLServer #PowerShell

A screenshot of the output of Export-DbaInstance, which produces a bunch of files related to SQL Server
Joel Bennett
2 weeks ago

Here's why you have to be careful who you listen to about #AI and #ChatGPT. The so-called experts are crazy.

People are repeating a so-called "ChatGPT Hack" that suggests you ask for a "confidence score" at the end of each question.

ChatGPT is a large language model. It doesn't actually understand what you're saying. It doesn't know what a confidence score is.

It just knows what words would probably come after an answer to that prompt:

Confidence: 9/10

#PowerShell #DotNet #StringBuilder

An example ChatGPT prompt and incorrect answer:

ChatGPT PROMPT:

Please convert the following C# to PowerShell:

       public static string GetRenderedScript(Token[] tokens)
        {
            var sb = new StringBuilder();
            int lastEndOffset = 0;
            for (var i = 0; i < tokens.Length; i++)
            {
                sb.Append(
                    Symbols.Space,
                    tokens[i].Extent.StartOffset - lastEndOffset);
            }

            sb.Append(Ansi.Colors.Reset);
            return sb.ToString();
        }

At the end of your answer, rate your confidence in the answer using following the format where x is the confidence score of your output by 10:    

Confidence: x/10

ChatGPT RESPONSE:

Certainly! Here's the PowerShell equivalent of the given C# code:

function GetRenderedScript([Token[]]$tokens) {
    $sb = New-Object System.Text.StringBuilder
    $lastEndOffset = 0
    for ($i = 0; $i -lt $tokens.Length; $i++) {
        $sb.Append([string]::Copy(' ', $tokens[$i].Extent.StartOffset - $lastEndOffset))
    }
    $sb.Append($Ansi.Colors.Reset)
    return $sb.ToString()
}

$tokens = @()  # Replace with the actual tokens
GetRenderedScript -tokens $tokens

Confidence: 9/10
2 weeks ago

Logging into #Office365 to check on my coworkers #MFA settings in #Microsoft. So I head to the panel, there are some rudimentary sorts, for Enabled, and Enforced, and All. But what about for Disabled? Nope. So that means I have to slum it with #PowerShell. God, I hate PowerShell with every fiber of my being, and connecting to Office 365 is like playing blindfolded darts. So, fine, lets try #Connect-MsolService, which will fail horribly. This will eat the rest of the day. #today #infotech

James Bartlett :terminal:
2 weeks ago

Hey #PowerBI folks in the #TwinCities area, I'll be giving a presentation called "#PowerShell Hacks for Power BI" at the #PASSMN meetup on Tuesday evening. Come check it out and say hi!
https://www.meetup.com/mn-sql-server-user-group-passmn/events/293161340/

RT Alvin Ashcraft 🐿
PowerShell Extension for Visual Studio Code Spring 2023 Update by Steve Lee and Sydney Smith.
#powershell #vscode #scripting
https://devblogs.microsoft.com/powershell/powershell-extension-for-visual-studio-code-spring-2023-update/

:sys_twitter: https://twitter.com/alvinashcraft/status/1655920556317999105

Rich Howell
3 weeks ago

Hey Everyone!

I am Rich 👋, I work as a #SQLServer Developer and Accidental #DBA , I write #csharp code and #powershell

I volunteer on the railway in my spare time as a Footplate Fireman & Social Media Manager.

I also help maintain Actual Budget #OSS , have a passion for loud music and #photography and recently started learning about Video Editing.

#introduction

#PowerShell script that allows you to interact with OpenAI's #ChatGPT

https://github.com/yzwijsen/chatgpt-powershell

Sophos X-Ops
2 months ago

The Windows #shortcut pointed to a #PowerShell command. Obviously, because that's totally normal, right? 🙄​

But the shortcut had been modified so that the Target field in its Properties sheet appeared blank.

Apparently there's a little bug in Windows. Microsoft already knows about it, because it was revealed in a blog post by researcher @x86matthew@twitter.com a year ago. If you mess around with a shortcut and prepend a big chunk of "space" characters, the Target field still works but the command will be hidden from the end user.

https://www.x86matthew.com/view_post?id=embed_exe_lnk

The threat actor used this exact technique.

The command executed by the Windows shortcut is a PowerShell "Invoke-WebRequest" download of a VBS.

#GuLoader #Remcos #maltax #malware

5/

The actual command executed by the Windows shortcut is a PowerShell "Invoke-WebRequest" download of a VBS
Clayton Errington 🖥️
2 months ago

How about some digital Spring Cleaning this time of the year. Always a good idea to review your digital files and clean out your digital life as well. Something a data hoarder is not good at...

https://claytonerrington.com/blog/spring-cleaning/

#100DaysToOffload post 26!

#windows #powershell #linux #bash #shell

RT Doug Finke
Start your journey to learn #PowerShell with Polyglot Notebooks powered by .NET Interactive and VS @code.
Access the code on GitHub: https://github.com/dfinke/powershell-notebooks
Empower your #coding skills with interactive and versatile notebooks! 🚀

:sys_twitter: https://twitter.com/dfinke/status/1641814102992637954

Mike Goatly
2 months ago

I'm sure this is well known in #powershell circles, but seriously PowerShell, you're weird.

Command prompt with command "$null.Length" and a result of zero

RT Doug Finke
Crunch and visualize data with #PowerShell using Polyglot Notebooks VS @code! 📊📈
Discover amazing features and benefits with GA support for PowerShell and more.
📖 Read: https://dfinke.github.io/powershell,%20polyglot,%20interactive%20notebooks,%20scottplot/2022/12/28/Interactive-Plotting-with-PowerSheLL-and-Polyglot-Interactive-Notebooks.html
💻 Code on GitHub: https://github.com/dfinke/PowerShellScottPlot
📹 Watch: https://youtu.be/nL0JRukCU4k

:sys_twitter: https://twitter.com/dfinke/status/1637825823188172800

Claudia Regio
2 months ago

Did you miss our #vscode Polyglot Notebooks livestream this morning with @cecilphillip ?? Not a problem - catch up on the recording here to learn how notebooks are a great tool for exploring SDKs!

https://www.youtube.com/watch?v=cY9wHDhJA6Y

#jupyter #csharp #fsharp #powershell #javascript #html #sql #kql #mermaid #stripe #dotnet

Claudia Regio
2 months ago

Want to use multiple languages in a notebook while getting rich IntelliSense? Check out the #vscode Polyglot Notebooks extension, now in GA!🎉

#polyglotnotebooks has language server support and variable sharing for C#, JavaScript, SQL, & more!
👉 https://aka.ms/PolyglotNotebooksGA

#csharp #fsharp #javascript #powershell #javascript #html #sql #mermaid #kql #jupyter #dotnet

Hank G ☑️
3 months ago
Now a couple weeks into using Windows on a daily basis again I have to say the most acceptable parts of the experience to me are WSL, Git Bash Shell, and VS Code: i.e. the least Windows part of Windows. It's not just a familiarization aspect. Performance lag is a big part too. Based on @dominucco experiment with Power Shell on Linux a couple years ago I thought I would get into PowerShell. Maybe after some more time I would but as of now it is a big thumbs down for me. The biggest disappointment for me is Visual Studio. Twenty years ago, the last time I used it as my primary IDE for C/C++ it was the best IDE by a mile. I have now found CLion to be more effective for working with CMake projects. I'm sure for doing Windows development VS is the best option. I'm glad I'm in a position not to have to do Windows development as my primary target platform. In the mean time I can't wait to exist mostly in my little Linux world again :) #windows #clion #VisualStudio #wsl #PowerShell #linux

If you share #PowerShell code online, please don't use aliases in your examples. Beginners may not understand it, and we don't want people to think PowerShell is a cryptic language. Take the time to show the full command. Then, if you want, show the shortcut way with aliases. Do more than share code. Teach. Anyone can do it.

Anyone Can Cook
James Bartlett :terminal:
3 months ago

Hey #PowerBI peeps, I'll be on #ToolTalk with Artur König and @mthierba on Tuesday, March 21st.

We'll be talking about a little #ExternalTool I wrote for #PowerBIDesktop called #PbiToolsWatchPS, which launches a #PowerShell window running #pbitools in #WatchMode on the current #pbix file. The purpose of this little tool is to minimize the effort and number of steps necessary to #commit changes to Power BI #reports and #datasets into a proper #VersionControl system like #GitHub, #AzureDevOps, etc.

Please join us #LIVE on Tuesday, March 21st, give us your thoughts about the current state of #CICD and #DevOps / #DataOps for Power BI, and tell us about your favorite #ToolsOfTheTrade!

RSVP for the #ToolTalk session on #LinkedIn here:
https://lnkd.in/gzZSxf_f

Download #pbitools here:
https://pbi.tools

Download #PbiToolsWatchPS here:
https://github.com/JamesDBartlett3/PowerBits/blob/main/ExternalTools/046-PbiToolsWatchPS5.1.pbitool.json

mdgrs
3 months ago

I have released a PowerShell module called 'DynamicTitle'. With the module, you can make your console titles pretty.

https://github.com/mdgrs-mei/DynamicTitle

In the GitHub project page, there is a clip showing some examples, such as Status bar, Git status and Command execution time. It's all non-blocking and live-updating.

It's amazing if people enjoy the customization using this module.

#PowerShell

On Hyper terminal and Windows Terminal, the PowerShell titles are showing live information such as date, CPU usage, and command execution time.
fopks :fox_dance:
3 months ago

Upgrading #PowerShell, expect literally everything to break 😌

Does anyone have a working example with a Powershell or other script in Windows, that pops up a web view or system browser to authenticate the person running the script to OAuth2 using implicit flow or authorization code grant (PKCE)?

Running in circles and falling into rabbit holes trying to find examples.

Or, less explicitly, popping up the system browser to do some user interaction and get some value back.

#OAuth2 #powershell
Sasha
3 months ago

What #PowerShell version are you on?

mdgrs
3 months ago

It seems to be safe to modify WindowTitle from a background thread. Unlike the prompt string, it can be updated in real time without blocking or being blocked by the main thread. It's a fun area to customize😉

#PowerShell

The WindowTitle of a PowerShell console is updated in real time. It shows the current directory, time and CPU usage.

@malwaretech when I asked #chatgpt for the best #darkstar the #GratefulDead ever played, it offered a show that the Dead ever played! It also knows just enough #powershell to be quite dangerous.

mdgrs
4 months ago

Testing a text area that stays on the top right corner of the console. It's almost working but the cursor irregularly blinks. Hmm.. it's close..

#PowerShell

On the PowerShell console, time and CPU usage percentage is shown on the top right corner and they are updated regularly.
Ænðr E. Feldstraw
4 months ago

#powershell has no #list #chunk function yet. It may arrive with version 7. A bit of an oversight for a batch scripting language, but also a good opportunity to do some #FOSS.

Ænðr E. Feldstraw
4 months ago

Today we'll figure out how to create a shell script, maybe using #powershell , to download known orders from #Amazon #SPAPI.

It looks like their #getOrders endpoint accepts up to 10 order numbers at a time. We have just a tad bit more than that.

We'll be using an #awslambda function we wrote in #python, that uses an #AWSStepFunction to call another lambda function to retrieve order items, and store the result in #awss3. Yay, systems integration!