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
{ | |
"builders": [ | |
{ | |
"type": "hyperv-iso", | |
"output_directory": "./output-{{ user `os_name` }}-base-hyperv/", | |
"temp_path": "C:\\ClusterStorage\\HYPData01\\PackerTemplates\\temp", | |
"vm_name": "{{ user `os_name` }}-base", | |
"iso_url": "{{ user `iso_url` }}", | |
"iso_checksum": "{{ user `iso_checksum` }}", | |
"iso_checksum_type": "sha1", |
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 UniversalDashboard | |
$Colors = @{ | |
BackgroundColor = "#FF252525" | |
FontColor = "#FFFFFFFF" | |
} | |
Start-UDDashboard -Content { | |
New-UDDashboard -Title "Employee registration form" -NavBarColor '#FF1c1c1c' -NavBarFontColor "#FF55b3ff" -BackgroundColor "#FF333333" -FontColor "#FF55b3ff" -Pages @( | |
New-UDPage -Url "/register/:id" -Endpoint { |
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
param ( | |
[string]$UserName | |
) | |
# Credential for the user mailbox to configure Out-of-office schedule for | |
$UserCredential = Get-AutomationPSCredential -Name $UserName | |
$Session = New-PSSession -ConfigurationName Microsoft.Exchange -ConnectionUri https://outlook.office365.com/powershell-liveid/ -Credential $UserCredential -Authentication Basic -AllowRedirection | |
$EXOModule = Import-PSSession $Session |
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
# Credential for the user mailbox to configure Out-of-office schedule for | |
$UserCredential = Get-Credential | |
$Session = New-PSSession -ConfigurationName Microsoft.Exchange -ConnectionUri https://outlook.office365.com/powershell-liveid/ -Credential $UserCredential -Authentication Basic -AllowRedirection | |
$EXOModule = Import-PSSession $Session | |
# Customize as needed - for example, setup as parameters for a function/script | |
$StartTime = Get-Date 08:00 | |
$EndTime = Get-Date 16:00 |
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
# Credential for the user mailbox to configure Out-of-office schedule for | |
$UserCredential = Get-Credential | |
$Session = New-PSSession -ConfigurationName Microsoft.Exchange -ConnectionUri https://outlook.office365.com/powershell-liveid/ -Credential $UserCredential -Authentication Basic -AllowRedirection | |
$EXOModule = Import-PSSession $Session | |
Get-Command -Module $EXOModule.Name | |
Get-Command -Module $EXOModule.Name | Format-Wide -Property Name -AutoSize |
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
param( | |
$UserPrincipalName | |
) | |
try { | |
Import-Module -Name AzureAD -ErrorAction Stop | |
Import-Module -Name MSGraphIntuneManagement -ErrorAction Stop | |
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 the module from the PowerShell Gallery | |
Install-Module -Name MSGraphIntuneManagement | |
# After installation, you can view available commands by using Get-Command: | |
Get-Command -Module MSGraphIntuneManagement | |
# Get an access token which can be leveraged for authenticating to the Microsoft Graph API for performing operations against the Intune service | |
$Credential = Get-Credential | |
$ClientId = '34d24e43-0ae1-4ed4-bdea-444073711c55' | |
$Token = Get-MSGraphAuthenticationToken -Credential $Credential -ClientId $ClientId |
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
# Dot source the function (optimally - place it in a module) | |
. C:\Scripts\Get-MSGraphAuthenticationToken.ps1 | |
# Define client ID for an Azure AD Application with necessary permissions against the Microsoft Graph API | |
$ClientID = "1950a258-227b-4e31-a9cf-717495945fc2" | |
# Credentials for the user who should be used for authentication | |
$Credential = Get-Credential | |
# Generate an access token |
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
# Guttenavn | |
$maledata = Invoke-WebRequest -Uri 'https://www.ssb.no/statistikkbanken/selectvarval/define.asp?SubjectCode=01&ProductId=01&MainTable=FornavnPersoner&contents=Personer&PLanguage=0&Qid=0&nvl=True&mt=1&pm=&SessID=3980226&FokusertBoks=1&gruppe1=Hele&gruppe2=Hele&VS1=NavnMenn01&VS2=&CMSSubjectArea=befolkning&KortNavnWeb=navn&StatVariant=&Tabstrip=SELECT&aggresetnr=1&checked=true' | |
# Jentenavn | |
$femaledata = Invoke-WebRequest -Uri 'https://www.ssb.no/statistikkbanken/selectvarval/define.asp?SubjectCode=01&ProductId=01&MainTable=FornavnPersoner&contents=Personer&PLanguage=0&Qid=0&nvl=True&mt=1&pm=&SessID=3980226&FokusertBoks=1&gruppe1=Hele&gruppe2=Hele&VS1=NavnKvinner01&VS2=&CMSSubjectArea=befolkning&KortNavnWeb=navn&StatVariant=&Tabstrip=SELECT&aggresetnr=1&checked=true' | |
$malenames = @() | |
$maledata.ParsedHtml.getElementsByTagName("OPTION") | foreach {$malenames += $_.text} |
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
# Initiates a new Pomodoro sprint, defaulting to 25 minutes duration. | |
Start-Pomodoro | |
# Initiates a new Pomodoro sprint with 10 minutes duration. A random audio-file will be started from the specified audio file path | |
Start-Pomodoro -Minutes 10 -AudioFilePath ~\Music\MusicToCodeByCollection -StartMusic | |
# Initiates a new Pomodoro sprint. A mobile device can be muted when starting the sprint and unmuting when the sprint is finished by using IFTT webhooks. | |
Start-Pomodoro -IFTTMuteTrigger start_pomodoro -IFTTUnMuteTrigger stop_pomodoro -IFTTWebhookKey abcdef | |
# In order to avoid having to specify a lot of parameters (we want to be productive, right?), a tip is to specify static information by using default parameter values (available in PowerShell 3.0 and later). Open your PowerShell profile (psedit $profile) and use the following syntax: |