Skip to content

Instantly share code, notes, and snippets.

Avatar
🏠
Working from home, yeah

Igor Andriushchenko doshyt

🏠
Working from home, yeah
View GitHub Profile
@doshyt
doshyt / getBinariesVersions.ps1
Last active Feb 15, 2019
Script to record versions of all binaries from the folder and subfolders to a CSV file. Useful to produce component lists in software builds.
View getBinariesVersions.ps1
$targetPath = "."
$candidateBin = @()
$candidateBin += Get-ChildItem -Path $targetPath -Recurse -Include *.dll,*.exe -Exclude *Nunit*,*test* |
ForEach-Object {
try {
$_ | Add-Member NoteProperty FileVersion ($_.VersionInfo.FileVersion)
} catch {}
$_
} | Select-Object BaseName,FileVersion
@doshyt
doshyt / Install-OmsAgent.ps1
Created Oct 1, 2018
Installs OMS agent from the ZIP archive that is created of the unpacked agent MSI
View Install-OmsAgent.ps1
Param(
[string]$AgentDownloadUrl="http://127.0.0.1/omsagent.zip",
[string]$WorkspaceId,
[string]$WorkspaceKey
)
try {
Write-Host "Downloading OMS agent"
Invoke-WebRequest -Uri $AgentDownloadUrl -OutFile omsagent.zip
Write-Host "Extracting OMS agent"
Add-Type -AssemblyName System.IO.Compression.FileSystem
View SqlAllowThroughFirewall.ps1
netsh advfirewall firewall add rule name = SQLPort dir = in protocol = tcp action = allow localport = 1433 remoteip = 10.0.0.0/16 profile = PUBLIC
@doshyt
doshyt / Get-UserAdGroups.ps1
Created Jul 24, 2017
One-liner for getting user group membership from AD
View Get-UserAdGroups.ps1
Import-Module ActiveDirectory; Get-ADPrincipalGroupMembership $(Get-AdUser -f {SamAccountNAme -like 'XXXYYY'})
You can’t perform that action at this time.