We can make this file beautiful and searchable if this error is corrected: No commas found in this CSV file in line 0.
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 -Version 3 | |
| function ConvertFrom-AADConnectDN { | |
| <# | |
| .SYNOPSIS | |
| Takes an encoded DN from Azure AD Connect and returns the immutableID | |
| .EXAMPLE | |
| "CN={7961504952763968323075686E79557A4D76547058513D3D}" | ConvertFrom-AADConnectDN |
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 Posh-SSH | |
| param ( | |
| [Parameter(Mandatory,ValueFromPipeline,ValueFromPipelineByPropertyName)][String]$Computername, | |
| [ValidateSet("Cisco","JunOS")] | |
| [Parameter(ValueFromPipelineByPropertyName)][String]$DeviceType = "Cisco", | |
| [String]$RepositoryPath = $home\desktop, | |
| [PSCredential]$Credential | |
| ) |
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
| #Fetch Build Helper Modules using Install-ModuleBootstrap script (works in PSv3/4) | |
| #The comma in ArgumentList a weird idiosyncracy to make sure a nested array is created to ensure Argumentlist | |
| #doesn't unwrap the buildhelpermodules as individual arguments | |
| #We suppress verbose output for master builds (because they should have already been built once cleanly) | |
| foreach ($BuildHelperModuleItem in $BuildHelperModules) { | |
| if (-not (Get-module $BuildHelperModuleItem -listavailable)) { | |
| write-verbose "Build Initialization: Installing $BuildHelperModuleItem from Powershell Gallery to your currentuser module directory" | |
| if ($PSVersionTable.PSVersion.Major -lt 5) { | |
| write-verboseheader "Bootstrapping Powershell Module: $BuildHelperModuleItem" |
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 Connect-FMServer { | |
| param ( | |
| #The hostname of your Fortimanager | |
| [Parameter(Mandatory)][Alias("Server","Hostname")][String]$ComputerName, | |
| #Your username and password. Must be enabled for remote API access | |
| [Parameter(Mandatory)][PSCredential]$Credential, | |
| #Disable SSL Checks. THe name on the certificate must still match what you specified for -ComputerName | |
| [Switch]$Force | |
| ) |
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 PrtgAPI -version 5 | |
| using namespace PrtgAPI | |
| function Get-PRTGDeviceSysInfo { | |
| <# | |
| .SYNOPSIS | |
| Retrieve PRTG Device System Information via the (undocumented) API. | |
| .EXAMPLE | |
| Get-PRTGDeviceSysInfo -ID 13926 |
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-NiceXML { | |
| [CmdletBinding()] | |
| param ( | |
| #Object to Input | |
| [Parameter(ValueFromPipeline)]$InputObject, | |
| #Name of the root document node. Defaults to "Objects" | |
| $RootNodeName = "Objects" | |
| ) | |
| begin { |
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 -version 5 -module PoshRSJob | |
| function Measure-MemoryUse ([ScriptBlock]$ScriptBlock,$CallOperator) { | |
| function GetMem([switch]$RunGC) { | |
| [int]([gc]::GetTotalMemory($RunGC) / 1MB) | |
| } | |
| $result = [ordered]@{} | |
| $result.ScriptBlock = $ScriptBlock |
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
| <# | |
| .SYNOPSIS | |
| Fetches Azure Key Vault credentials using a managed service identity with a more lightweight approach than the Az powershell module | |
| .EXAMPLE | |
| .\Get-AzFunctionsKeyVaultCredential.ps1 -Identifier https://MYKEYVAULTNAME.vault.azure.net/secrets/MYSECRETNAME | |
| .EXAMPLE | |
| .\Get-AzFunctionsKeyVaultCredential.ps1 -KeyVaultName MYKEYVAULTNAME -KeyNme MYSECRET | |
| .OUTPUT | |
| System.Management.Automation.PSCredential |
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 -version 5 | |
| #requires -module BuildHelpers,InvokeBuild,Az.Automation,Az.Profile | |
| #Azure Automation | |
| #Uses Invoke-Build (https://github.com/nightroman/Invoke-Build) | |
| param ( | |
| #Where to perform the building of the module. Defaults to "Release" under the project directory. You can specify either a path relative to the project directory, or a literal alternate path. | |
| [String]$BuildOutputPath, | |
| #The azure subscription to use |
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 Reset-ADUserPermissions { | |
| [CmdletBinding()] | |
| param ( | |
| [Parameter(ValueFromPipeline)][String]$UserName | |
| ) | |
| process { | |
| $rootDSE = Get-ADRootDSE | |
| $defaultSDDL = (Get-ADObject -SearchBase $RootDSE.schemaNamingContext -ldapFilter '(&(Objectclass=classSchema)(name=user))' -Properties defaultSecurityDescriptor).defaultsecuritydescriptor |