This file contains 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-ContainerNodes { | |
<# | |
.SYNOPSIS | |
Returns all nodes inside a folder | |
.DESCRIPTION | |
Returns all nodes inside of a 'folder' as a IResultObject. | |
These IResultObjects are for use with the ConfigurationManager PowerShell Modules. | |
Requires a path to work. You can use the name switch to get a parent directory only. | |
.PARAMETER SitePath |
This file contains 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-ForcastedTemp { | |
$whereami = Invoke-RestMethod -Uri 'http://ip-api.com/json/' | select lat, lon | |
$grid = Invoke-RestMethod -Uri "https://api.weather.gov/points/$($whereami.lat),$($whereami.lon)" | |
$hourly = Invoke-RestMethod -Uri $grid.properties.forecast | |
$current = $hourly.properties.periods[0] | |
Write-Host ('Forcasted temperature is {0}F {1}' -f $current.temperature, $current.name.tolower()) | |
} |
This file contains 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
$releases = 'https://www.vaultproject.io/downloads' | |
$YOUR_VAULT_INSTANCE = 'https://your.vault.com:8200' | |
function Get-Latest { | |
$download_page = (Invoke-WebRequest -Uri $releases -UseBasicParsing).links | |
$url = $download_page | ? href -match 'windows_amd64.zip$' | select -expand href | |
$version = $url -split '/' | select -Last 1 -Skip 1 | |
return @{ | |
url = $url | |
version = $version |
This file contains 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
<# | |
Find all task sequences where a application is referrenced. | |
$App name should match the admin console name | |
#> | |
$App = Get-CMApplication -Name 'AppName' | |
$TaskSeqIDs = (Invoke-CMWmiQuery -Query "select * from SMS_TaskSequenceAppReferencesInfo where RefAppModelName like '$($App.Modelname)'").PackageID | |
foreach ($TS in $TaskSeqIDs) { | |
$TaskName = (Get-CMTaskSequence -Fast -TaskSequencePackageId $TS).Name | |
Write-host ('App: {0} found in: {1}' -f $App.LocalizedDisplayName, $TaskName) |