This file contains hidden or 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
    
  
  
    
  | function Wait-File { | |
| <# | |
| .SYNOPSIS | |
| Monitors a file system path for changes and executes a script block in response to specified events. | |
| .DESCRIPTION | |
| The Wait-File function creates a FileSystemWatcher to monitor a specified directory for file system changes. | |
| It registers event handlers for specified events (Created, Changed, Deleted, Renamed) and executes a | |
| custom action when those events occur. The function runs continuously until manually stopped (Ctrl+C). | 
  
    
      This file contains hidden or 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
    
  
  
    
  | return "This is a demo script file." | |
| # Find Me: https://jdhitsolutions.github.io | |
| # Any one can learn syntax and mechanics. | |
| # Let's focus on the squishy bits - what you should write | |
| # and what not to write | |
| #region Essential rules | 
  
    
      This file contains hidden or 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
    
  
  
    
  | #Requires -module ThreadJob | |
| param( | |
| #Filter modules to update by name, otherwise will update all modules | |
| [string[]]$Name = @(), | |
| [ValidateSet('AllUsers', 'CurrentUser')] | |
| $Scope = 'CurrentUser', | |
| $ThrottleLimit = 30 | |
| ) | |
| try { | 
  
    
      This file contains hidden or 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
    
  
  
    
  | @{ | |
| RootModule = 'CustomTypeExample.psm1' | |
| ModuleVersion = '0.1.0' | |
| GUID = '2779fa60-0b3b-4236-b592-9060c0661ac2' | |
| Author = 'mikey' | |
| CompanyName = 'Unknown' | |
| Copyright = '(c) mikey. All rights reserved.' | |
| FunctionsToExport = @( | |
| 'New-AcceleratedClass' | |
| 'New-UsableClass' | 
  
    
      This file contains hidden or 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
    
  
  
    
  | # Reference: | |
| # https://devblogs.microsoft.com/commandline/shell-integration-in-the-windows-terminal/ | |
| param | |
| ( | |
| [ValidateSet('WindowsTerminal', 'ITerm2')] | |
| [String]$TerminalProgram = 'WindowsTerminal' | |
| ) | |
| # Restore hooked functions in case this script is executed accidentally twice | 
  
    
      This file contains hidden or 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
    
  
  
    
  | #requires -module Az.Keyvault,Microsoft.PowerShell.SecretManagement | |
| filter Register-AzKeyVault { | |
| <# | |
| .SYNOPSIS | |
| Registers an Azure Key vault as a local SecretManagement vault. | |
| .EXAMPLE | |
| Register-AzKeyVault 'MyVault' | |
| .EXAMPLE | |
| Register-AzKeyvault M<tab> | |
| .EXAMPLE | 
  
    
      This file contains hidden or 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
    
  
  
    
  | function Get-AzTenantId { | |
| <# | |
| .SYNOPSIS | |
| Resolves the tenant ID for a specified name. | |
| .OUTPUTS | |
| System.Guid. The Tenant ID of the specified name | |
| #> | |
| [CmdletBinding()] | |
| param( | |
| #The tenant string you wish to resolve. Examples include: mydomain.com, myorg.onmicrosoft.com | 
  
    
      This file contains hidden or 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
    
  
  
    
  | #requires -module Indented.StubCommand | |
| function Enable-AutoMockRecord ([Switch]$Append) { | |
| $env:AUTOMOCK_RECORD = $true | |
| if ($Append) {$env:AUTOMOCK_APPEND = $true} | |
| } | |
| function Disable-AutoMockRecord { | |
| Remove-Item env:AUTOMOCK_RECORD -ErrorAction SilentlyContinue | |
| Remove-Item env:AUTOMOCK_APPEND -ErrorAction SilentlyContinue | |
| } | 
  
    
      This file contains hidden or 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
    
  
  
    
  | function ConvertTo-PascalCase | |
| { | |
| [OutputType('System.String')] | |
| param( | |
| [Parameter(Position=0)] | |
| [string] $Value | |
| ) | |
| # https://devblogs.microsoft.com/oldnewthing/20190909-00/?p=102844 | |
| return [regex]::replace($Value.ToLower(), '(^|_)(.)', { $args[0].Groups[2].Value.ToUpper()}) | 
NewerOlder