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 | |
| Scan an Azure subscription for resources using certificate pinning–related configurations. | |
| .NOTES | |
| Requires: Az PowerShell modules | |
| #> | |
| # Login if needed | |
| if (-not (Get-AzContext)) { | |
| Connect-AzAccount |
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
| $Users = Import-csv .\users.csv | |
| #Maak een groep aan per afdeling | |
| $Users.department | Select-Object -Unique | ForEach-Object { | |
| New-LocalGroup -Name $_ -Description "Group for department $_" | |
| } | |
| #Breid de CSV uit met functie/rol per user | |
| #Maak een groep aan per functie/rol | |
| $Users.function | Select-Object -Unique | ForEach-Object { | |
| New-LocalGroup -Name $_ -Description "Group for function $_" |
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 | |
| Create local users | |
| .DESCRIPTION | |
| Create local users based on input | |
| .EXAMPLE | |
| New-INGUser -FirstName Pietje -LastName Puk -Gender M -Department IT | |
| .EXAMPLE | |
| New-INGUser Pietje Puk -Gender M -Department IT | |
| .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
| trigger: | |
| - main | |
| pool: | |
| vmImage: ubuntu-latest | |
| variables: | |
| azureServiceConnection: 'AZ400-CZ' | |
| steps: |
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
| { | |
| "$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentParameters.json#", | |
| "contentVersion": "1.0.0.0", | |
| "parameters": { | |
| "location": { | |
| "value": "westeurope" | |
| }, | |
| "name": { | |
| "value": "CZApp" | |
| } |
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
| targetScope = 'subscription' | |
| @description('Specifies the location for resources.') | |
| param location string | |
| param name string | |
| resource rg 'Microsoft.Resources/resourceGroups@2022-09-01' = { | |
| name: name | |
| location: location | |
| } |
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
| # Starter pipeline | |
| # Start with a minimal pipeline that you can customize to build and deploy your code. | |
| # Add steps that build, run tests, deploy, and more: | |
| # https://aka.ms/yaml | |
| trigger: | |
| - main | |
| pool: | |
| vmImage: ubuntu-latest |
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 | |
| A function to create a user. | |
| .DESCRIPTION | |
| A function to create a user on the AzureAD. | |
| .PARAMETER FirstName | |
| Provide the first name of the user to be created. | |
| .PARAMETER LastName | |
| Provide the last name of the user to be created. | |
| .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
| Install-Module -Name PSScriptAnalyzer -Force | |
| Get-Command -Module PSScriptAnalyzer | |
| Invoke-ScriptAnalyzer -Path D:\PowerShell\script.ps1 | |
| Invoke-ScriptAnalyzer -Path D:\PowerShell\script.ps1 | Out-GridView | |
| (1..10 | foreach { | |
| measure-command { | |
| D:\PowerShell\script.ps1 |
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
| #region Prep | |
| $Files = Get-ChildItem d:\ -Recurse | |
| #endregion Prep | |
| #region Hex | |
| 0xfd | |
| #endregion Hex | |
| #region Location, location, location | |
| Push-Location 'D:\Methos' |
NewerOlder