Skip to content

Instantly share code, notes, and snippets.

Ben R. tabs-not-spaces

View GitHub Profile
@tabs-not-spaces
tabs-not-spaces / Connect-iDrac.ps1
Created Mar 21, 2019
Connect to iDrac console from PowerShell
View Connect-iDrac.ps1
function Connect-iDrac {
[CmdletBinding()]
param (
[IPAddress]$dracHost,
$dracUser
)
try {
$cred = Get-Credential -UserName $dracUser -Message "Please enter iDrac credentials.." -Title "Connect-iDrac"
$jrePath = "C:\bin\jre1.7.0_80" #set to your jre binaries root folder.
$kvmJar = "$jrePath\avctKVM.jar"
@tabs-not-spaces
tabs-not-spaces / chrome-install.ps1
Created Mar 15, 2019
Install the latest version of chrome - every time. without fail.
View chrome-install.ps1
try {
Write-Host "downloading installer.."
$chromeUri = "https://dl.google.com/chrome/install/latest/chrome_installer.exe"
$bitsJob = Start-BitsTransfer -Source $chromeUri -Destination "$env:Temp\$(split-path $chromeUri -leaf)"
if (Test-Path -Path "$env:Tempchrome_installer.exe") {
Write-Host "Installer downloaded successfully..`nInstalling application"
$proc = Start-Process -FilePath "$env:Tempchrome_installer.exe" -ArgumentList "/silent /install" -Wait
$fileDetectPath = "${env:ProgramFiles(x86)}\Google\Chrome\Application\Chrome.exe"
Write-Host "Looking for installation files: $fileDetectPath.."
if (Test-Path -Path "$fileDetectPath") {
View logon script
<#
.SYNOPSIS
Logon script for the EUC Environment.
.DESCRIPTION
Configures the following things:
- Map Network Drives if the UNC path is connectable (must be onPrem)
.NOTES
Author: Ben Reader
Company:
@tabs-not-spaces
tabs-not-spaces / Reset-SidecarScript.ps1
Created Apr 16, 2018
Intune authentication example
View Reset-SidecarScript.ps1
function Get-IntuneToken {
param (
$credential,
$token
)
if (!(Get-Module -Name MSGraphIntuneManagement -ListAvailable -ErrorAction SilentlyContinue)) {
Install-Module -Name MSGraphIntuneManagement -Scope CurrentUser -Verbose -Force
}
$GMTDate = [System.TimeZoneInfo]::ConvertTimeBySystemTimeZoneId($(Get-Date), [System.TimeZoneInfo]::Local.Id, 'GMT Standard Time')
if ($token -ne $null) {
You can’t perform that action at this time.