Skip to content

Instantly share code, notes, and snippets.

View mark05e's full-sized avatar

mark05E mark05e

View GitHub Profile
@mark05e
mark05e / install-python-embeddable-x64.cmd
Last active November 2, 2023 02:46
script to download, extract and setup pip using embeddable python package. tested on win10
set PY_URL=https://www.python.org/ftp/python/3.9.5/python-3.9.5-embed-amd64.zip
mkdir c:\python
cd /d c:\python
:: Download & extract python
curl %PY_URL% -o python-embed.zip
Powershell Expand-Archive -Force python-embed.zip C:\python
:: Install pip
*://contbullceni.files.wordpress.com/*
*://issuu.com/*
*://img.meiasola.com.br/*
*://b2b.canecreek.com/*
*://server04.angrymetalguy.com/*
*://xqxi.stregattobb.it/*
*://ioia.francescobognin.it/*
*://goa.guideavventura.it/*
*://filemap411.weebly.com/*
*://news-coffee.hatenablog.com/*
#ref: http://eddiejackson.net/wp/?p=23710
# https://www.microsoft.com/en-ca/microsoft-365/onedrive/download
# Variables
$WebFile = "https://go.microsoft.com/fwlink/p/?LinkID=844652&clcid=0x1009&culture=en-ca&country=CA"
$PPath = "C:\TempPath\OneDriveInstaller"
$ProcName = "OneDriveSetup.exe"
# Create the folder anyway
New-Item -ItemType "directory" -Path $PPath | Out-Null
# https://stackoverflow.com/questions/24771455/getting-the-users-documents-folder-in-powershell
[enum]::GetNames( [System.Environment+SpecialFolder] ) |
Select @{ n="Name"; e={$_}},
@{ n="Path"; e={ [environment]::getfolderpath( $_ ) }}
# simple alternative
"MyDocuments: " + [environment]::getfolderpath("MyDocuments") ;`
"Desktop: " + [environment]::getfolderpath("Desktop") ;`
"Personal: " + [environment]::getfolderpath("Personal") ;`
@mark05e
mark05e / Get-InstalledApp.ps1
Created July 7, 2021 02:14 — forked from Bill-Stewart/Get-InstalledApp.ps1
Get-InstalledApp.ps1
# Get-InstalledApp.ps1
# Written by Bill Stewart ([email protected])
#
# Outputs installed applications on one or more computers that match one or
# more criteria.
#
# Version history:
#
# Version 1
# * Written for PowerShell 1.0. Lost in the mists of time.
# RESET OFFICE ACTIVATION STATE
# https://docs.microsoft.com/en-us/office/troubleshoot/activation/reset-office-365-proplus-activation-state
# by: https://gist.github.com/mark05e
#
# Lines to look out for:
# > The four steps above can be automated using OLicenseCleanup.vbs. Simply download and run the script with elevated privileges.
# > To clear all WAM accounts associated with Office on the device, download and run the signoutofwamaccounts.ps1 script with elevated privileges.
# > To automate WPJ removal, download WPJCleanUp.zip, extract the folder, and run WPJCleanUp.cmd.
@mark05e
mark05e / grabRegistryUninstallStrings.ps1
Created July 17, 2021 17:42 — forked from brianfgonzalez/grabRegistryUninstallStrings.ps1
Quick snippet to output a grid of all uninstall strings from the registry.
$ColRegUinst = @()
(Get-Item -Path 'HKLM:\software\WOW6432Node\Microsoft\Windows\CurrentVersion\Uninstall').GetSubKeyNames() |
%{
if ( (Get-Item -Path "HKLM:\software\WOW6432Node\Microsoft\Windows\CurrentVersion\Uninstall\$_").GetValue("DisplayName") -ne $null)
{
$ObjRegUinst = New-Object System.Object
$ObjRegUinst | Add-Member -Type NoteProperty -Name Publisher -Value (Get-Item -Path "HKLM:\software\WOW6432Node\Microsoft\Windows\CurrentVersion\Uninstall\$_").GetValue("Publisher")
$ObjRegUinst | Add-Member -Type NoteProperty -Name Name -Value (Get-Item -Path "HKLM:\software\WOW6432Node\Microsoft\Windows\CurrentVersion\Uninstall\$_").GetValue("DisplayName")
$ObjRegUinst | Add-Member -Type NoteProperty -Name Uninstall -Value (Get-Item -Path "HKLM:\software\WOW6432Node\Microsoft\Windows\CurrentVersion\Uninstall\$_").GetValue("UninstallString")
$ColRegUinst += $ObjRegUinst
function Get-InstalledSoftware
{
<#
.SYNOPSIS
Reads installed software from registry
.PARAMETER DisplayName
Name or part of name of the software you are looking for
.EXAMPLE
# ref:
# - https://rmm.datto.com/help/en/Content/4WEBPORTAL/Monitor/CustomComponentMonitor.htm
# - https://rmm.datto.com/help/en/Content/4WEBPORTAL/Components/InputVariables.htm
# - https://rmm.datto.com/help/en/Content/4WEBPORTAL/Components/Scripting.htm
# - https://dectur.com/datto-bitlocker/
# - https://www.cyberdrain.com/dattocon-resources/
# - https://rmm.datto.com/help/en/Content/4WEBPORTAL/Components/Scripting.htm?Highlight=Agent%20variables
# -
function write-DRRMAlert ($message) {
@mark05e
mark05e / rename-onedrive-duplicates-with-computername.ps1
Last active July 20, 2021 03:29
Rename duplicate files inside onedrive with hostname in the filenames
$CheckPath = $env:onedrive
$CheckInFileName = $env:computername
$CheckFileExtensions = "dbf|cdx|cvw"
$ScriptDBFileName = "RenameDB__" + $(get-date -f yyyyMMddTHHmmss) + ".csv"
$ScriptDBFilePath = "C:\Temp"
$ScriptDBFileFullPath = "$($ScriptDBFilePath)" +"\"+ "$($ScriptDBFileName)"
$FileList = Get-ChildItem -Path $CheckPath\*$CheckInFileName* -Recurse | where {(! $_.PSIsContainer) -and ($_.extension -match $CheckFileExtensions)} | select-object Name, LastWriteTime, Directory, Length
$FilesToProcess = @()