#Powershell
Did you know you can resolve file and directory paths that don’t exist in #PowerShell. Not with Resolve-Path or Join-Path though; that would be too easy 😛
https://blog.danskingdom.com/Resolve-PowerShell-paths-that-do-not-exist/
#PowerShell Miniconf the fall edition of #PSConfEU
The Gather platform 👇
🕹️ 2D environment, retro-gaming feel, making meetings more interactive.
👾 Avatars walk in and out of a conversation, where the cameras and microphones are enabled when they get close-by
💬 Talk with #PSConfEU speakers, the @PowerShell_Team
or your peers!

In #PowerShell Universal v4.2, you'll be able to setup minimal environments for jobs that just use STDOUT and STDERR. This means you'll be able to directly run and schedule things like #python scripts.


My premium #PowerShell subscribers are learning more about managing extended file properties. https://jeffhicks.substack.com/p/more-property-management-options

Did you know you can get a 7-day trial to my #PowerShell newsletter, which includes access to all part articles? How much do you think you can read? https://jeffhicks.substack.com/subscribe?simple=true&next=https%3A%2F%2Fjeffhicks.substack.com%2Fp%2Fmore-property-management-options&utm_source=paywall-free-trial&utm_medium=web&utm_content=137175371&coupon=b81b2aab
I wrote the following #powershell command to find out who had written line containing "MongoDbHealthCheck". I'm pretty happy with it but I suspect it can be written more concise on #linux with awk and xargs and such. Any #scripting gurus out there that are of a challenge?
git grep MongoDbHealthCheck HEAD | sls "HEAD:(.*?):(\d+):" | %{ $null,$p,$l = $_.Matches.Groups.Value; git blame -L "$l,$l" $p HEAD }
Still time to register for today’s webinar, Responding at Scale with Magnet RESPONSE. I’ll be online for Q&A for the 1pm and 4pm sessions. #DFIR #PowerShell #triage #IncidentResponse https://www.magnetforensics.com/resources/responding-at-scale-with-magnet-response/
:microsoft: :azure:
Wenn der #Selbsthass keine Grenzen kennt, kann man mit #PowerShell und #MicrosoftGraph Benutzer anlegen und zu #MsTeams hinzufügen.
Man braucht zwischen den Vorgängen nur unzählige Start-Sleep und "Hat-das-jetzt-funktioniert?"-Abfragen, weil die tatsächliche Cloud-Befehlsverarbeitung etwas länger dauert und nachfolgende Befehle ins Leere gehen würden. 🤪🔫
Quick Use of #OpenAI to end processes using #PowerShell
It’s definitely getting better, but still always have to double check like all code you didn’t write.
https://clatent.com/2023/09/quick-use-of-openai-end-processes/
The #PowerShell tiPS module v0.5 is out. This version remembers which tips have been shown to prevent some tips from being shown repeatedly while others have not been been shown yet.
The latest release of PSBlitz:
- Adds more data to the database-specific "Statistics Info" report page
- Adds more info to the "Instance Info" report page, including a new "Top 10 clients by connections" section.
https://github.com/VladDBA/PSBlitz
#sqlserver #sqldba #powershell #microsoftsqlserver #mssqlserver #mssql #mssqldba #PSBlitz
**7 highly useful #PowerShell tools https://www.computerworld.com/article/3689703/highly-useful-powershell-tools.html**
@yosh #PowerShell isn't text-based. Of course, you can pipe text, but objects too. It was this and the scriptability that drew me to "Monad", it's early codename. Rather than modifying scripts for slight variations when needed, I wrote cmdlets with boundless composability. Written in #csharp.
This is one of the #PowerShell modules I use almost every day. https://github.com/jdhitsolutions/PSClock
https://techhub.social/@bmo/111127362388612416
That’s not silly, @bmo, this is silly:
function Single-Dice-Roller([int]$str) {
$maxNum = $str + 1
$rollResult = Get-Random -Minimum 1 -Maximum $maxNum
Write-Output "You rolled $rollResult on d$str"
}
Set-Alias -Name roll -Value Single-Dice-Roller
> roll 20
> You rolled 6 on d20
Inspired by someone’s problem choosing a game to play.
Sometimes @alsorew does silly things for no reason.
Fate/Fudge 🎲Dice Roller in Powershell
function Fate-Dice-Roller {
$rollFateDie1 = -1, 0, 1 | Get-Random
$rollFateDie2 = -1, 0, 1 | Get-Random
$rollFateDie3 = -1, 0, 1 | Get-Random
$rollFateDie4 = -1, 0, 1 | Get-Random
$rollFateDice = $rollFateDie1 + $rollFateDie2 + $rollFateDie3 + $rollFateDie4
Write-Output "You rolled $rollFateDice on 4dF ($rollFateDie1, $rollFateDie2, $rollFateDie3, $rollFateDie4)"
}
Set-Alias -Name rollf -Value Fate-Dice-Roller
> rollf
> You rolled -1 on 4dF (0, 0, 0, -1)

#PowerShell Universal App Designer training video https://youtu.be/UP6K9xESetk
Hi #powershell friends, I could use your help, I'm trying to permanently delete a #sharepoint team site and it does using #pnppowershell but while completing it says it can't find the group. Has any come across this? https://github.com/DevClate/365AutomatedLab/issues/14#issue-1911181902 Much appreciated!
Sending this one around again for the weekend #DFIR warriors. The blog has links to the #PowerShell script and an upcoming webinar you can register for, “Responding at Scale with Magnet RESPONSE”. https://infosec.exchange/@dwmetz/111091660638834820
Blocking Visual Studio Code embedded reverse shell before it's too late
https://ipfyx.fr/post/visual-studio-code-tunnel/
#ycombinator #security #powershell #Active_Directory #Bloodhound
@ekis I use vs code to edit #powershell script, document the with markdown, and illustrate them with a draw.io. works great here.
@deadlydog Some interesting results. In my last #powershell book I showed how to use C# with #pwsh. Fun stuyff
Do you create classes and enums in #PowerShell? Which approach do you use?
https://blog.danskingdom.com/PowerShell-class-definition-pros-cons-and-performance-comparison/
#PowerShell Weekly is out now! https://psweekly.dowst.dev/?p=6220
Have you kept up with new submissions to the #PowerShell Gallery? https://github.com/jdhitsolutions/PSGalleryReport
My Outlook folder shortcut opens the email when there is only one unread email, and opens the folder instead if there are many unread emails.
https://github.com/mdgrs-mei/outlook-taskbar-notifier
It doesn't work with the New Outlook for Windows unfortunately😢
@archer72 So far as I know, there is no way to run a Win10 system (VM or real) without a GUI. But you can certainly use #powershell
ANd did you mean WIndows PowerShell or POwershell (7). They are similar but different
@archer72 #PowerShell is cross platform, just use it on your Linux/Mac
Check out this awesome Homebrew #PowerShell Universal app! Pretty amazing! https://forums.ironmansoftware.com/t/real-world-examples/7000/44?u=adam
@mabster In #PowerShell, when you cast $null to string you get an empty string, which is not the same as $null
[string]$x = $null
$x -ne $null # TRUE
If you want to SET a string to $null so you can null coalesce with it, you have to use NullString, like this:
[string]$x = [NullString]::Value
$x -eq $null # TRUE
$x ?? 'test' # test
For what it's worth, an empty string and $null are both false-ish, so you can use a ternary:
$x ? $x : 'test'
#PowerShell Tip: Here's a simple way to see what version of the .NET Framework you are using.

My premium #PowerShell subscribers are learning more about managing extended file properties. https://jeffhicks.substack.com/p/more-property-management-options

@sreagle @Perl Regarding your Redmond OS: Use #WindowsSubsystemForLinux (#WSL) or #PowerShell for more portable quoting
"update-module microsoft.graph" should come with a warning: "This is almost guaranteed to break your scripts due to undocumented changes or untested implementations." Sigh...was wondering why a bunch of stuff was failing and it seems they put out a bum update which they've since sent out yet another module update to fix. #PowerShell #MSGraph #SloppyQA
Learn a #PowerShell tip every day by running 3 commands.

Wrote a small #ChatGPT & Git wrapper in #PowerShell to generate commit messages based on git status and git diff outputs. Works well, writing those has always felt like a chore.
Prefer this to using a VSCode extension as I can stick it in my $Profile and it's available everywhere.
@mcc
#PowerShell is much easier to understand if you break the code into smaller chunks and run it directly in PowerShell *as a shell* (rather than running `powershell.exe -Command …`, which requires lots of escape characters, so it gets very messy).
Example:
```PowerShell
# Declare drive letter to be ejected
$driveLetter = "E:\"
# Initialize a new shell application com object
$driveEject = New-Object -ComObject Shell.Application
# Use the shell application com object to eject the drive
$driveEject.Namespace(17).ParseName("$driveLetter").InvokeVerb("Eject")
```
I hope this helps, but if not, please feel free to let me know, and I'd be happy to help troubleshoot. ☺️
Spent the week learning to create Docs as Code. Finally wrote it all down including #MkDocs #PowerShell #VMware #vCenter. Enjoy
http://blog.faucher.net/2023/09/automagical-vcenter-documentation-with.html
#vExpert
If you write #PowerShell you should check out Jakub Jareš' #Profiler module. In under a minute you can easily see which parts of your code are the slowest, and how slow they actually are so you know if they are worth optimizing.
https://blog.danskingdom.com/Easily-profile-your-PowerShell-code-with-the-Profiler-module/
@JamesDBartlett3 Luv it! I think piping is the ididomatic way to code in #powershell. Also I've heard it comes with a performance penalty.
But honestly: I've never done something in powershell that was actually performance critical
One of my #PowerShell hacks for #PowerBI just got a huge #upgrade: #Pipeline support!
In layman's terms, this means that one #function can be strung together with another function in a single PowerShell command, and the outputs from the first function feed directly into the second's inputs. The best part is that the whole chain of functions can operate as a #stream, so as soon as the first item is available, it gets passed down to the next function in the chain, which begins processing that item, while the previous function is working on the next item in the queue. It's like an #AssemblyLine for data!
Of course, now I'll have to go back and apply this technique to all of the other functions I've written previously. #NoRestForTheWicked 😈
@adam Sweetn - it would be really wonderful to see the #PowerShell 7 commands to set this up for, say, Contoso.Com
like this:
```
$webClient = New-Object Net.WebClient
foreach ($file in $downloads.Keys) {
$url = $downloads[$file]
$webClient.DownloadFile($url, $file)
}
```
#powershell
As always, my SANS Institute teaching scripts for my PowerShell course (SEC505) are free and in the public domain at:
https://BlueTeamPowerShell.com
I teach SEC505 again starting Sept 25, streaming live online. Hope to see you then for six days of PowerShell DevSecOps fun!
#PowerShell #InfoSec #SANS @sans_isc #Security #DevOps #DevSecOps #BlueTeam
Second post is about how I use #wezTerm and some tricks to integrate with #powershell. The next post will probably cover how I use #starship.
https://gilbertsanchez.com/posts/my-terminal-wezterm/
Update: Yesterday's #PowerShell Hacks for #PowerBI session was recorded, and is now available on #YouTube!
https://www.youtube.com/watch?v=DM69QDD3y7Q
Hey #PowerBI and #PowerShell peeps! My "#PowerShellHacks for Power BI" #Livestream with the #TriPASS #UserGroup (#Durham, #NorthCarolina) is starting in 45 minutes (6PM Eastern).
Please join us, bring your toughest PowerShell for Power BI questions, and get ready to learn some amazing tricks for automating and administering Power BI at scale with PowerShell!
#Meetup link: https://www.meetup.com/tripass/events/295221539/
Oh wow, so Powershell has these cmdlets (commandlets) that convert output to different formats, like a list or HTML, or even a GUI grid rather than a text table that's hard to listen to with a screen reader. You can even do a CSV and import to Excel or something.
Format as list:
Get-Process -Name lsass | Format-List
GUI Grid:
Get-Process -Name lsass | Out-GridView
@SwiftOnSecurity well.... its not that Windows does not have a #Powershell
Pour le boulot, je travail sur une petite application web écrite en #golang pour gérer des utilisateurs et des projets dans un AD Microsoft.
Je dois me taper du #PowerShell pour certaines actions...quel calvaire...
C'est une vraie punition de bosser sur des environnements Microsoft 😢
I've been working on #PowerBits (a collection of #PowerShell scripts for #PowerBI 📊 #Admins) recently, and I just made a minor breakthrough. 💪😎👍
One of the biggest missing features of the Power BI #RESTAPIs right now is the ability to export a #Dataset as a #PBIX file. Of course, you can export a #Report as a PBIX file, and if that Report is bound to a Dataset, then the Dataset will be included with the Report when you export it. However, if the Dataset you need to export doesn't have a Report bound to it (I've started calling this a #BareDataset), then the #RESTAPI can't help you. That Dataset can only be exported manually from the Power BI Service using a web browser. Yuck! 🤮
To solve this problem:
1. Find and select a target #BareDataset
2. Upload a #BlankReport to the same #Workspace
3. Re-bind the blank Report to the bare Dataset
4. Export the blank Report as a PBIX file
5. Delete the blank Report from the Workspace
Step 1 Complete (mostly) 😅:
https://github.com/JamesDBartlett3/PowerBits/blob/main/PowerShell/Get-PowerBIBareDatasetsFromWorkspaces.ps1
Today I made the lights behind my monitor turn brighter automatically, when an app on my PC is accessing the webcam.
Windows shows you in the settings app which app is currently accessing your webcam, and it turns out you can read those values from the registry.
Using Sysmon I can watch for changes in the registry that indicate that an app's started / stopped accessing my webcam and fire Events into the Windows eventlog, and then I attached a Task to those events that forwards the new registry key to #HomeAssistant through a webhook.
Depending on the value sent, HomeAssistant can then turn my lights bright to act as a key light, or reactivate the adaptive lighting that continuously adjusts the light's color based on the time of day :3
Edit: part 1.5 is here, the threading broke: https://corteximplant.com/@Sirs0ri/110794659498930158
(re) #Introduction due to a server migration...
Hi, i'm Kyle. Long-time systems engineer (IT) turned technical marketer with a passion for automation, problems of scale, and sharing knowledge. I'm a blogger, presenter, mentor, mentee, and I recently found myself on the management side of things. Professionally, I've been recognized through advocacy programs like #Microsoft MVP, #VMware vExpert, #Cisco Champion, (Dell) EMC Elect, etc.
Former road warrior, while having greatly enjoyed traveling the world, I'm finding satisfaction in watching those loyalty statuses drop each year. My camera roll was more receipts than anything else for quite a while. Current #FloridaMan, I swear it wasn't like this when we moved here, but I enjoy a relaxing beach and grew allergic to snow and cold weather.
My feed is likely to include #tech, #startup, #cloud, #devops, #terraform, #powershell, with the occasional #beer, #nfl, #mlb, #f1, #dog, #cat, #travel, #Purdue, mention.
I have quite a lot more followers than I did when I first wrote my introduction, so it’s only fair that I’m writing a new one, bump up the major version.
#introduction #intro #introductions
Hi! o/
I am Ștefan (ș as sh, I also accept Stephan or the equivalent in your language). I’m 21 years old, ♑, he/him, proud #leftist and soon to graduate CS @ UVABc. Sort of proudly living in #romania. My native language is Romanian, fairly proficient at English, slowly learning #finnish (and #italian).
Tried a lot of programming languages in my childhood up until now, a non-chronological list of ones that stuck with me for one reason or another being: VB6 (that’s what I started on at 8 years old), #pascal (+ #freepascal and #delphi), #perl (+ #raku), #tcl #tcltk, #lisp (usually #scheme, on a good day #elisp #emacslisp and #commonlisp), #elixir, #php, #forth, #lua, #oberon, #modula-2, #cpp #c++, #ocaml, #fsharp, #smalltalk (+ #squeak #pharo #self), #ada, #powershell, #dart, #matlab, #rlang, #zig, #nim, #cobol and #julia. I don’t claim full proficiency in all of these, but I’m familiar enough with these (+ some others not mentioned here) that I could get along just fine with 2 weeks at most of studying and looking through cookbooks and examples). I’m flexible in learning new languages and technologies if needed.
I also do #sudoku and #math for fun (especially functional equations and number theory problems, sometimes calculus and geometric algebra). I am interested in #linguists, #conlangs (#lojban and #esperanto) and #nlp, contemporary (post-‘45, usually post-‘89 for me) history, #balkan history, lower-level stuff (I like to learn about how tools around me work, I’m most interested in #compilers, #emulators and #microcontrollers), #typography and #latex, #linux + #bsd, #msdos, #amiga, #oberon, #plan9, #philosophy, #astronomy (especially in a worldbuilding context) and #philosophy, along with other less notable interests.
I engage in #politics relatively often irl, although I’m not inserting it in absolutely every scenario in my life. As I mentioned, I’m a #leftist and #progressive (or… um… #woke) (Nazis and fascists can have a merry fuck off, DNI with me). I am also a spiritual person, a #deist (if you really want to put it that way, an agnostic, although it’s not quite true) and I find #astrology and #tarot interesting (I’ll let you guess my moon and ascendant, let’s see how close you are).
With that being said, I hope I’m welcome here, you can pick your subset of things that interest you from this list, you have plenty of options. :P Quite a bit longer than last time, but oh well…
@davidshq so long as you don’t need crazy platforms, a Go binary would be a “write it once” option. Beyond that, I think #PowerShell is good for windows and Bash on everything else unless you are okay telling people to install PowerShell (it works well on Linux and macOS)
#question of the day: I want to automate a few steps in setting up a git repo for specific projects. On #Linux I could use a #Bash script...what about on #Windows? #Powershell? I know I could use #WSL or other tools like Cygwin but I'd like this to be something folks don't need to know about Linux to utilize.
Ideally, it would be cross-platform.
@feditips
Are you a #powershell fan and new to #Mastodon ? This thread and others like it is all you need to read to get yourself acclimated.
My #PowerShell terminal today.
I have two cats in the terminal that pass by sometimes. If there is an error, they stop walking! 🐈🐈⬛
https://gist.github.com/mdgrs-mei/11121aceb7e147dbe6ab4ab8d2abcd35
#ICYMI Be sure to check out this week's livestream with #MVP @dfinke 🎉 We had a blast running through #polyglot notebooks #ChatGPT and #PowerShell in VS Code ▶️ https://youtube.com/live/U9S4BMqJPQ8 https://t.co/RPQuVyo9zZ
:sys_twitter: https://twitter.com/code/status/1672354848862351360
⏳ We're live in 10 minutes with @burkeholland and @dfinke. We'll demo #ChatGPT in three different environments! Join us ▶️ https://youtube.com/live/U9S4BMqJPQ8
#copilot #PowerShell #Polyglot https://t.co/EY7P6EsjDo
:sys_twitter: https://twitter.com/code/status/1671893322649190400
AzLogDcrIngestPS - This module can ease the steps, if you want to send any data to Azure LogAnalytics custom logs (v2) - using the new features of Azure Log Ingestion Pipeline, Azure Data Colection Rules & Log Ingestion API. Think of this module as an "AnyConnector", which can be used to send data from any 3rd party source using PS script (intermediate) or use as part of a script collecting data from endpoint. It can be used in Powershell scripts, Azure Function, Azure Automation, etc.
📢 We're excited to welcome MVP Doug Finke to the livestream to demo #ChatGPT in #copilot #polyglotnotebooks and #PowerShell #AI Integration! Mark your calendar 📆 and join us on Thursday🎬 https://aka.ms/code-livestream-page
8 am Seattle / 11 am New York / 4 pm London
@dfinke https://t.co/kE74HFyVP8
:sys_twitter: https://twitter.com/code/status/1670499380971859968
@JenMsft I even wrote a #PowerShell module to help me manage it. https://github.com/jdhitsolutions/WTToolbox
@StepanResl Thank you so much for having me as a guest on the #PowerBIKaficko #podcast again, this time talking about #PowerShell and #PowerBI! I had a lot of fun, and I truly hope your listeners did as well! 😊
This is the most extended episode of the #PowerBIKaficko podcast with Jiří Neoral. This episode was with @JamesDBartlett3, and James talked about #PowerBI and #PowerShell. Thank you so much for the knowledge that you have shared with us, James.
Link: https://open.spotify.com/episode/706wt2JXs0A1wMIp8rLbIN?si=8451ee57f2284163