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
| <# | |
| List taken from SO answer: | |
| http://stackoverflow.com/questions/4730152/what-indicates-an-office-open-xml-cell-contains-a-date-time-value | |
| #> | |
| $ExCellStyles = @{ | |
| 0 = 'General' | |
| 1 = '0' | |
| 2 = '0.00' | |
| 3 = '#,##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
| function ConvertFrom-SID { | |
| param ( | |
| [Parameter(Position = 0, Mandatory = $True)] | |
| [String] | |
| [ValidateNotNullOrEmpty()] | |
| $SID | |
| ) | |
| $AccountSIDInstance = Get-CimInstance -ClassName Win32_AccountSID -Filter "Setting = 'Win32_SID.SID=`"$SID`"'" |
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 -Modules ActiveDirectory | |
| function Get-ADUserPasswordExpiration | |
| { | |
| param( | |
| [Parameter(Mandatory=$true,ValueFromPipeline=$true,ValueFromPipelineByPropertyName=$true)] | |
| [Alias('DistinguishedName')] | |
| [Microsoft.ActiveDirectory.Management.ADUser[]]$Identity | |
| ) |
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
| $Properties = 'employeeID' | |
| # Retrieve all workers with their "manager" attribute | |
| Get-ADUser -Filter "title -like '*worker*'" -Properties @('manager';$Properties) |ForEach-Object { | |
| # Iterate over workers, retrieve each workers manager individually | |
| [pscustomobject]@{ | |
| Worker = $_ | |
| Manager = Get-ADUser -Identity $_.manager -Properties $Properties -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
| $source = "C:\LabResources\xTimeZone" | |
| $destination = "C:\temp" | |
| $Version = (Get-ChildItem -Path $source -Depth 1).Name | |
| $ResoureName = (Get-ChildItem -Path $source -Depth 1).Parent.Name | |
| $ModuleName = $ResoureName+'_'+$Version | |
| New-Item -Path ($destination+'\'+$ModuleName) -ItemType Directory |
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-WSManTrust { | |
| (Get-Item -Path WSMan:\localhost\Client\TrustedHosts | % Value).split(',') | |
| } | |
| function New-WSManTrust { | |
| param( | |
| [string]$hostname | |
| ) | |
| Set-Item -Path WSMan:\localhost\Client\TrustedHosts -Value $hostname -Concatenate -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
| function Get-AzSpotPrice { | |
| [CmdletBinding()] | |
| param ( | |
| #VM SKU (e.g. Standard_F8s) | |
| [String]$Sku, | |
| #Azure Region (e.g. brazilsouth) | |
| [String]$Region, | |
| #ODATA filter to use on the data | |
| [String]$Filter, | |
| #Maximum number of records to retrieve, or specify 'Unlimited' for all records. Defaults to 100. This behaves like the Exchange Cmdlets |
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-Base64KMSEncryptedString { | |
| [CmdletBinding()] | |
| param ( | |
| [Parameter( | |
| Mandatory = $true, | |
| ValueFromPipeline = $true | |
| )] | |
| [String[]] | |
| $String, |
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
| Import-Module Polaris -Verbose | |
| Import-Module PSHTML -Verbose | |
| Add-Type -AssemblyName System.Web | |
| New-PolarisGetRoute -Path "/Login" -Scriptblock { | |
| $HTML = html { | |
| head { | |
| Title "Login Page" | |
| } |
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
| ################################################# | |
| # Terraform vs. Pulumi vs. Crossplane # | |
| # Infrastructure as Code (IaC) Tools Comparison # | |
| # https://youtu.be/RaoKcJGchKM # | |
| ################################################# | |
| ######### | |
| # Setup # | |
| ######### |
OlderNewer