I hereby claim:
- I am zbalkan on github.
- I am zbalkan (https://keybase.io/zbalkan) on keybase.
- I have a public key ASBBqweJA8AtahYGZFH_5frCdso79FPav7P4qXIcoLlVMAo
To claim this, I am signing this object:
| #Hosts | |
| $Source = "Source ESXi Server IP address/Hostname" | |
| $Target = "Target ESXi Server IP address/Hostname" | |
| # Creds | |
| $root = "root" | |
| $rootPassword = "root password" | |
| $admin = "administrator@vsphere.local" # Not used here. It will be needed when enumerating all hosts. | |
| $adminPassword = "administrator password" # Not used here. It will be needed when enumerating all hosts. |
| ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDh53gwlEcTH9HXjfJ9ojVFn3WhWHVcH52rkGWpn1nq/jXb2+qhiefS10DpRQDCyCCHOvc0vDgKUbD1bP7Qp97NacccOCMNaU8N120tQe/UrN4MM/5RLjYk2rNwUn3HdERIHUWG3DE9Xa2kGadO3/69aaDGNw9sFk+FwkiwUpi5xhV8WjZf6FRZmlkVpPf3g3id+AH1boNFVUdiR6A3rO3EPXTsJq3Ib8I3e3U6do6OkEOLp0Ot1DdDhIrNm3OsahYyGZ6jiFJTOTbSIsiyNqqmIR/B3QK//6tzBVMz9klaQs08nMBLaywbsyvadPQJzdHMR8hk+d8InvQQh711oZaz zafer@HP |
| # Configuration variables | |
| $PrintServer = "" | |
| $CSVFilePath = "printers.csv" | |
| $XMLFilePath = "printers.xml" | |
| # The code | |
| Import-Module ActiveDirectory | |
| $Domain = (Get-ADDomain).name |
| #Requires -Modules GPRegistryPolicyParser | |
| #Requires -Version 5 | |
| Import-Module -Name GPRegistryPolicyParser -WarningAction Ignore | |
| Add-Type -AssemblyName System.Windows.Forms | |
| $Script:response = [System.Windows.Forms.MessageBox]::Show("Do you want to open current hives?`n`nClick Yes to display current hives on this computer.`nClick No to pick a `'registry.pol`' file to read.", "Open current hives?", [System.Windows.MessageBoxButton]::YesNoCancel, [System.Windows.MessageBoxImage]::Question) | |
| switch ($Script:response) | |
| { |
| #Requires -Version 3 | |
| # In this scenario, it is assumed that each user will have a home folder, including 3 sub-folders as a template. | |
| # The tree can be visualized like below: | |
| # | |
| # Home | |
| # |_ user1 | |
| # |_ user2 | |
| # |_ user3 | |
| # |_ user4 |
| [user] | |
| name = Zafer Balkan | |
| email = zafer@zaferbalkan.com | |
| username = zbalkan | |
| signingkey = EECD6A2984E3EEE3 | |
| [init] | |
| defaultbranch = master | |
| [core] | |
| pager = delta | |
| autocrlf = true |
| # Reg2CI (c) 2021 by Roger Zander | |
| if((Test-Path -LiteralPath "HKLM:\SOFTWARE\Classes\Applications\photoviewer.dll") -ne $true) { New-Item "HKLM:\SOFTWARE\Classes\Applications\photoviewer.dll" -Force -ErrorAction SilentlyContinue }; | |
| if((Test-Path -LiteralPath "HKLM:\SOFTWARE\Classes\Applications\photoviewer.dll\shell") -ne $true) { New-Item "HKLM:\SOFTWARE\Classes\Applications\photoviewer.dll\shell" -Force -ErrorAction SilentlyContinue }; | |
| if((Test-Path -LiteralPath "HKLM:\SOFTWARE\Classes\Applications\photoviewer.dll\shell\open") -ne $true) { New-Item "HKLM:\SOFTWARE\Classes\Applications\photoviewer.dll\shell\open" -Force -ErrorAction SilentlyContinue }; | |
| if((Test-Path -LiteralPath "HKLM:\SOFTWARE\Classes\Applications\photoviewer.dll\shell\open\command") -ne $true) { New-Item "HKLM:\SOFTWARE\Classes\Applications\photoviewer.dll\shell\open\command" -Force -ErrorAction SilentlyContinue }; | |
| if((Test-Path -LiteralPath "HKLM:\SOFTWARE\Classes\Applications\photoviewer.dll\shell\open\DropTarget") -ne $true) { New- |
| <# | |
| .Synopsis | |
| Shows Windows native credential dialog on PowerShell 7.x and VS Code. | |
| .DESCRIPTION | |
| The cmdlet utilizes Windows native code based on P/Invoke calls. The parameters and output are the same as Get-Credential cmdlet. Based on the example: https://www.developerfusion.com/code/4693/using-the-credential-management-api/ | |
| .SYNTAX | |
| Get-WinCredential [[-UserName] <string>] -Message <string> [<CommonParameters>] | |
| .EXAMPLE | |
| Get-WinCredential | |
| .EXAMPLE |
I hereby claim:
To claim this, I am signing this object:
| <# | |
| .Synopsis | |
| Time-based One-Time Password Algorithm (RFC 6238) | |
| .DESCRIPTION | |
| Based on the script of Jon Friesen - https://gist.github.com/jonfriesen/234c7471c3e3199f97d5 | |
| .EXAMPLE | |
| Get-OTP -Secret 'ABCDEFGHIJKLMNOPQRSTUVWXYZ234567' # Default OTP length is 6 digits and period is 30 seconds | |
| .EXAMPLE | |
| totp -Secret 'ABCDEFGHIJKLMNOPQRSTUVWXYZ234567' # you can use totp or otp alias | |
| .EXAMPLE |