View compareWriteToDB.ps1
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
[CmdletBinding()] | |
param ( | |
[Parameter(Mandatory=$true)] | |
[ValidateSet('DbaDBTableData','SqlCommand')] | |
$Method, | |
[Parameter(Mandatory=$true)] | |
$Path, | |
[Parameter(Mandatory=$true)] | |
$ServerInstance, | |
[Parameter(Mandatory=$true)] |
View gist:35c27389b21388292d14ea1345f802fb
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
$api = iwr 'https://chocolatey.org/api/v2/Search()?`$filter=IsLatestVersion&`$skip=0&`$top=30&searchTerm=%27zip%27&targetFramework=%27%27&includePrerelease=false' | |
[xml]$xml = $api.content | |
foreach ($entry in $xml.feed.entry) { | |
[PSCustomObject]@{ | |
Name = $entry.title."#text" | |
FriendlyName = $entry.Properties.Title | |
Author = $entry.Author.name | |
Version = $entry.Properties.Version | |
Published = $entry.Properties.Published."#text" |
View gist:3fb8f260cfc6f7f2bacb43b65b3a38ec
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
New-HTML -TitleText 'Software' -UseCssLinks:$true -UseJavaScriptLinks:$true -FilePath C:\inetpub\wwwroot\reports\software\softwareoverview\softwareoverview.html { | |
New-HTMLTab -TabName 'Licensed Software' { | |
New-HTMLContent { | |
New-HTMLTable -DataTable ($licensedSoftware | Select-Object Name,Version,Publisher,Computername,InstallDate,Collected) -PagingOptions @(100, 200) -Filtering -FilteringLocation Top | |
} | |
} | |
New-HTMLTab -TabName 'Freeware' { | |
New-HTMLContent { | |
New-HTMLTable -DataTable ($freeSoftware | Select-Object Name,Version,Publisher,Computername,InstallDate,Collected) -PagingOptions @(100, 200) -Filtering -FilteringLocation Top | |
} |
View dyp.ps1
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 parse-dypCommand ($Command) { | |
$tokens = $null | |
$errors = $null | |
[System.Management.Automation.Language.Parser]::ParseInput($command, [ref]$tokens, [ref]$errors) | Out-Null | |
foreach($token in $tokens){ | |
$index = (0..($tokens.Count-1)) | where {$tokens[$_] -eq $token} | |
$token | Add-Member -NotePropertyName Index -NotePropertyValue $index | |
} | |
View rocky.txt
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
Set-WindowsExplorerOptions -EnableShowHiddenFilesFoldersDrives -EnableShowProtectedOSFiles -EnableShowFileExtensions | |
Install-WindowsUpdate -AcceptEula | |
Get-AppxPackage "XINGAG.XING" | Remove-AppxPackage | |
Disable-BingSearch |
View boxy.txt
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
# Description: Boxstarter Script | |
# Author: Jess Frazelle <jess@linux.com> | |
# Last Updated: 2017-09-11 | |
# | |
# Install boxstarter: | |
# . { iwr -useb http://boxstarter.org/bootstrapper.ps1 } | iex; get-boxstarter -Force | |
# | |
# You might need to set: Set-ExecutionPolicy RemoteSigned | |
# | |
# Run this boxstarter by calling the following from an **elevated** command-prompt: |
View VeeamRepo.ps1
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
New-UDRow { | |
New-UDColumn -Size 6 -Content { | |
$Repo = @( | |
@{Space = "free"; Count = (Invoke-RestMethod -headers @{Authorization = "Bearer <token> "} -method GET -uri "https://172.16.221.200:1281/v2/backupRepositories/2").freeSpace} | |
@{Space = "used"; Count = (Invoke-RestMethod -headers @{Authorization = "Bearer <token> "} -method GET -uri "https://172.16.221.200:1281/v2/backupRepositories/2").usedSpace} # dont know if this a valid request | |
) | |
New-UDChart -Title "SBKP1-VEEAM1 Repo Space" -Type Doughnut -Endpoint { | |
$Repo | New-UDChartDataset -DataProperty Count -Label "GB" -BackgroundColor "#42f44e" -HoverBackgroundColor "#42f44e" | |
} -Options @{cutoutPercentage = 0} |
View DiskPie.ps1
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
$disks = Get-CimInstance -ClassName Win32_LogicalDisk | |
ForEach ($disk in ($disks | where Drivetype -EQ 3)) { | |
$Data = @( | |
@{Space="used";Count=([Math]::Round((($disk.Size / 1GB) - ($disk.FreeSpace / 1GB)), 2))} | |
@{Space="free";Count=([Math]::Round($disk.FreeSpace / 1GB, 2))} | |
) | |
New-UDColumn -Size 2 { | |
New-UDChart -Title "$($disk.DeviceID)" -Type Doughnut -Options @{cutoutPercentage = 0} -Endpoint { | |
$Data | Out-UDChartData -LabelProperty "Space" -Dataset @(New-UDLineChartDataset -Label "Disk" -DataProperty Count) | |
} |
View diskspace.ps1
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
$disks = Get-WmiObject -ClassName Win32_LogicalDisk -ComputerName $Computername | |
ForEach ($disk in $disks) { | |
New-UDColumn -Size 3 { | |
New-UdChart -Title "Speicherplatz" -Type Doughnut -Endpoint { | |
[PSCustomObject]@{ | |
DeviceId = $disk.DeviceID; | |
Size = [Math]::Round($disk.Size / 1GB, 2); | |
FreeSpace = [Math]::Round($disk.FreeSpace / 1GB, 2); | |
} | Out-UDChartData -LabelProperty "DeviceID" -Dataset @( |