QuietShell – Executing PowerShell without a Console Window

For some time I've used a simple VBScript wrapper in code projects and scheduled tasks to allow silent execution of PowerShell scripts in the user context without displaying a console window: p = CreateObject("Scripting.FileSystemObject").GetParentFolderName(WScript.ScriptFullName) location = p &"\"& WScript.Arguments(0) command = "powershell.exe -nologo -ExecutionPolicy Bypass -File """ &location &"""" set shell = CreateObject("WScript.Shell") shell.Run command,0 … Continue reading QuietShell – Executing PowerShell without a Console Window

Harnessing AI in PowerShell: Prompting like a Pro

Understanding Effective AI Prompting: Core PrinciplesClarity and SpecificityContext is KingStructured Problem PresentationIterative RefinementError Message InclusionVersion and Environment DetailsPerformance RequirementsSecurity ContextCode GenerationCode Review and OptimizationBest Practices ImplementationThe Art of Iterative PromptingStarting with a Basic PromptRefining Your PromptFollowing UpExtended PowerShell-Specific ExamplesScenario 1: Active Directory User ManagementScenario 2: Performance OptimizationUnderstanding AI's Problem-Solving ApproachAdvanced Prompting TechniquesRole-Based PromptingComparative PromptingEducational PromptingThe … Continue reading Harnessing AI in PowerShell: Prompting like a Pro

Activating PIM Roles that require MFA or Conditional Access Authentication Context with PowerShell

For some time, I've been activating and scheduling activations for Azure roles under Privileged Identity Management (PIM) using the Microsoft Graph PowerShell SDK. However recently we secured these role activations to require a conditional access authentication context with MFA. This basically requires me to MFA when I activate a role with PIM. Problem is, by … Continue reading Activating PIM Roles that require MFA or Conditional Access Authentication Context with PowerShell