Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion File-Management-Scripts/Convert-Csv-To-Xlsx.ps1
Original file line number Diff line number Diff line change
@@ -1,7 +1,12 @@
# ConvertCsvToXlsx.ps1

# Need to define $onedrivepath variable if not already defined
if (-not $onedrivepath) {
$onedrivepath = 'C:\users\jason.lamb\OneDrive - middough'
}

# Define the folder to monitor
$watchFolder = 'C:\Users\jason.lamb\OneDrive - middough\Downloads\csv2xlsx'
$watchFolder = "$onedrivepath\Downloads\csv2xlsx"
$processedFolder = Join-Path $watchFolder 'Processed'

# Ensure the processed folder exists
Expand Down
7 changes: 6 additions & 1 deletion File-Management-Scripts/compare-source-destination-files.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,14 @@
# Created Date : 2025-09-04
# Modified Date : 2025-09-04

# Need to define $onedrivepath variable if not already defined
if (-not $onedrivepath) {
$onedrivepath = 'C:\users\jason.lamb\OneDrive - middough'
}

param(
[string] $SourceFile = 'S:\Corporate\MIS\Project List Download.xlsx',
[string] $DestFolder = 'C:\Users\jason.lamb\OneDrive - middough\General - IT\U & N Drive clean up',
[string] $DestFolder = "$onedrivepath\General - IT\U & N Drive clean up",
[string] $BaseName = 'Project List Download', # filename prefix before the date
[string] $SearchMask = 'Project List Download*.xlsx' # existing destination pattern
)
Expand Down
7 changes: 6 additions & 1 deletion File-Management-Scripts/compare-two-xlsx-files.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,14 @@
# Created Date : 2025-09-04
# Modified Date : 2025-09-04

# Need to define $onedrivepath variable if not already defined
if (-not $onedrivepath) {
$onedrivepath = 'C:\users\jason.lamb\OneDrive - middough'
}

param(
# Where your dated project list XLSX files live
[string] $Folder = 'C:\Users\jason.lamb\OneDrive - middough\General - IT\U & N Drive clean up',
[string] $Folder = "$onedrivepath\General - IT\U & N Drive clean up",
# Pattern to match the dated files (e.g., "Project List Download 090425.xlsx")
[string] $SearchMask = 'Project List Download*.xlsx',

Expand Down
9 changes: 7 additions & 2 deletions HEIC-Convert-To-JPG/convert-png-to-ico.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -78,11 +78,16 @@ function Convert-PngToMultiResIco {
}


Convert-PngToMultiResIco -PngPath "C:\Users\jason.lamb\OneDrive - middough\Documents\GitHub\PowerShell\HEIC-Convert-To-JPG\icon.png"
# Need to define $onedrivepath variable if not already defined
if (-not $onedrivepath) {
$onedrivepath = 'C:\users\jason.lamb\OneDrive - middough'
}

Convert-PngToMultiResIco -PngPath "$onedrivepath\Documents\GitHub\PowerShell\HEIC-Convert-To-JPG\icon.png"


<#
$pngPath = "C:\Users\jason.lamb\OneDrive - middough\Documents\GitHub\PowerShell\HEIC-Convert-To-JPG\icon.png"
$pngPath = "$onedrivepath\Documents\GitHub\PowerShell\HEIC-Convert-To-JPG\icon.png"

if (Test-Path $pngPath) {
Write-Host "✅ File exists : $pngPath"
Expand Down
7 changes: 6 additions & 1 deletion Miscellaneous/Create-Csv-To-Xlsx-Task.ps1
Original file line number Diff line number Diff line change
@@ -1,7 +1,12 @@
# CreateCsvToXlsxTask.ps1

# Need to define $onedrivepath variable if not already defined
if (-not $onedrivepath) {
$onedrivepath = 'C:\users\jason.lamb\OneDrive - middough'
}

# Define the path to the PowerShell script
$scriptPath = 'C:\Users\jason.lamb\OneDrive - middough\Documents\GitHub\PowerShell\Miscellaneous\ConvertCsvToXlsx.ps1'
$scriptPath = "$onedrivepath\Documents\GitHub\PowerShell\Miscellaneous\ConvertCsvToXlsx.ps1"

# Define the action to execute the PowerShell script
$action = New-ScheduledTaskAction -Execute 'PowerShell.exe' -Argument "-NoProfile -ExecutionPolicy Bypass -File `"$scriptPath`""
Expand Down
30 changes: 15 additions & 15 deletions Miscellaneous/ps-common-profile-COPY.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ function Start-CustomTranscript {
$username = $env:USERNAME
$hostname = $env:COMPUTERNAME
$timestamp = (Get-Date).ToString("yyyyMMdd_HHmmss")
$transcriptDir = "C:\Users\jason.lamb\OneDrive - middough\Documents\GitHub\PowerShell Transcript"
$transcriptDir = "$onedrivepath\Documents\GitHub\PowerShell Transcript"
$transcriptPath = "$transcriptDir\PStranscript-$hostname-$username-$timestamp.txt"

if (!(Test-Path $transcriptDir)) {
Expand Down Expand Up @@ -42,7 +42,7 @@ if ($profileContent -notmatch 'Import-Module\s+Terminal-Icons') {

# Load credentials from the file for each computer
# Construct the path to the credential file based on the computer name
$credPath = Join-Path -Path "C:\users\jason.lamb\OneDrive - middough\Documents\GitHub" -ChildPath "admincred-$env:COMPUTERNAME.xml"
$credPath = Join-Path -Path "$onedrivepath\Documents\GitHub" -ChildPath "admincred-$env:COMPUTERNAME.xml"

# Check if the credential file exists
if (Test-Path $credPath) {
Expand All @@ -56,10 +56,10 @@ if (Test-Path $credPath) {
} else {
Write-Warning "Credential file not found: $credPath"
Write-Warning "ENTER ADM CREDENTIALS"
#. "C:\Users\jason.lamb\OneDrive - middough\Documents\GitHub\set-save-admincred-per-computer.ps1"
#. "$onedrivepath\Documents\GitHub\set-save-admincred-per-computer.ps1"
}

# $admincred = Import-Clixml -Path "C:\Users\jason.lamb\OneDrive - middough\Documents\GitHub\admincred.xml"
# $admincred = Import-Clixml -Path "$onedrivepath\Documents\GitHub\admincred.xml"

####################

Expand All @@ -73,7 +73,7 @@ Write-Warning "ENTER ADM CREDENTIALS"

function Git-PowerShell-Private-Sync {

$repoPath = "C:\Users\jason.lamb\OneDrive - middough\Documents\GitHub\PowerShell-Private"
$repoPath = "$onedrivepath\Documents\GitHub\PowerShell-Private"

#START RENAME FILES WITH SPACES TO DASHES - PRIVATE

Expand Down Expand Up @@ -165,7 +165,7 @@ if ($trackedChanges) {
function Git-PowerShell-Sync {
param()

$repoPath = "C:\Users\jason.lamb\OneDrive - middough\Documents\GitHub\PowerShell"
$repoPath = "$onedrivepath\Documents\GitHub\PowerShell"
$datetime = Get-Date -Format 'yyyy-MM-dd HH:mm:ss'

if (-not (Test-Path -LiteralPath $repoPath)) {
Expand Down Expand Up @@ -266,7 +266,7 @@ function Git-PowerShell-Sync {

function Git-Commit-PowerShell-Private {

$repoPath = "C:\Users\jason.lamb\OneDrive - middough\Documents\GitHub\PowerShell-Private"
$repoPath = "$onedrivepath\Documents\GitHub\PowerShell-Private"
$datetime = Get-Date -Format 'yyyy-MM-dd HH:mm:ss'

if (-not (Test-Path -LiteralPath $repoPath)) {
Expand Down Expand Up @@ -352,7 +352,7 @@ function Git-Commit-PowerShell-Private {
####################

function Git-Commit-PowerShell {
$repoPath = "C:\Users\jason.lamb\OneDrive - middough\Documents\GitHub\PowerShell"
$repoPath = "$onedrivepath\Documents\GitHub\PowerShell"

#START RENAME FILES WITH SPACES TO DASHES

Expand Down Expand Up @@ -433,7 +433,7 @@ if ($trackedChanges) {
###################

function Git-jasrasr-Sync {
$repoPath = "C:\Users\jason.lamb\OneDrive - middough\Documents\GitHub\jasrasr.github.io"
$repoPath = "$onedrivepath\Documents\GitHub\jasrasr.github.io"

#START RENAME FILES WITH SPACES TO DASHES

Expand Down Expand Up @@ -509,7 +509,7 @@ Set-Alias jlgjs Git-jasrasr-Sync

####################

import-module 'C:\Users\jason.lamb\OneDrive - middough\Documents\GitHub\PowerShell-Private\MyCustomModule\mycustommodule.psm1'
import-module '$onedrivepath\Documents\GitHub\PowerShell-Private\MyCustomModule\mycustommodule.psm1'


####################
Expand Down Expand Up @@ -901,7 +901,7 @@ $clesccm = '\\clesccm\e$\application source\cad applications'
$middlocal = '\\middough.local\corp\data'
#Function np { & 'C:\Program Files (x86)\Notepad++\notepad++.exe' @args }
#Function notepadnew { & 'C:\Windows\System32\notepad.exe' @args }
$psexec = "C:\Users\jason.lamb\OneDrive - middough\Github\PsExec"
$psexec = "$onedrivepath\Github\PsExec"
$domain = "middough" #${domain} for no space
$domainup = "Middough" #${domain} for no space
$username = "jason.lamb" #${username} for no space
Expand Down Expand Up @@ -1149,7 +1149,7 @@ function Track-Package {

######################

. 'C:\Users\jason.lamb\OneDrive - middough\Documents\GitHub\!PS-custom-faq-help.ps1'
. '$onedrivepath\Documents\GitHub\!PS-custom-faq-help.ps1'

######################

Expand Down Expand Up @@ -1180,7 +1180,7 @@ function dell {
# https://www.dell.com/support/home/en-us/product-support/servicetag/7QBMYK3
# launches chrome in new window

#. 'C:\Users\jason.lamb\OneDrive - middough\Documents\GitHub\PowerShell-Private\File-Management-Scripts\compare-source-destination-files-and-csv-export-diff.ps1'
#. '$onedrivepath\Documents\GitHub\PowerShell-Private\File-Management-Scripts\compare-source-destination-files-and-csv-export-diff.ps1'

######################

Expand Down Expand Up @@ -1234,10 +1234,10 @@ if ($last -ne $today) {
# ===== Your once-per-day steps =====
try {
# 1) Security Now! fetch
& 'C:\Users\jason.lamb\OneDrive - middough\Documents\GitHub\PowerShell\GRC-TWIT-SecurityNow-Transcripts\download-next-security-now-txt-transcriptions-and-pdf-show-notes-from-grc_com.ps1'
& '$onedrivepath\Documents\GitHub\PowerShell\GRC-TWIT-SecurityNow-Transcripts\download-next-security-now-txt-transcriptions-and-pdf-show-notes-from-grc_com.ps1'

# 2) File compare + CSV diff
& 'C:\Users\jason.lamb\OneDrive - middough\Documents\GitHub\PowerShell-Private\File-Management-Scripts\compare-source-destination-files-and-csv-export-diff.ps1'
& '$onedrivepath\Documents\GitHub\PowerShell-Private\File-Management-Scripts\compare-source-destination-files-and-csv-export-diff.ps1'

# 3) Git sync function
jlgps2
Expand Down
7 changes: 6 additions & 1 deletion Miscellaneous/ps-custom-faq-help-COPY.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,11 @@
# Created Date : 2025-08-19
# Modified Date : Auto-updates when reloaded

# Need to define $onedrivepath variable if not already defined
if (-not $onedrivepath) {
$onedrivepath = 'C:\users\jason.lamb\OneDrive - middough'
}

$Revision = '1.5'
$CreatedDate = '2025-08-19'
$ModifiedDate = (Get-Date).ToString('yyyy-MM-dd')
Expand All @@ -23,7 +28,7 @@ function Show-JasonHelp {
# --- Help Text ---
$helpText = @"
# FAQ File Location
C:\Users\jason.lamb\OneDrive - middough\Documents\GitHub\!PS-custom-faq-help.ps1
$onedrivepath\Documents\GitHub\!PS-custom-faq-help.ps1

# Common Paths
C:\temp\powershell-exports\
Expand Down