Skip to content

Commit

Permalink
new stuff
Browse files Browse the repository at this point in the history
  • Loading branch information
Justin Grathwohl committed Nov 14, 2023
1 parent 009f743 commit 62ffac2
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 3 deletions.
10 changes: 7 additions & 3 deletions Client Configuration/Add-ADSitePrinters.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -47,14 +47,15 @@ function Get-ADComputerSite {
$getADModule = Get-Module -ListAvailable | Where-Object {$_.Name -eq "ActiveDirectory"}
If (!$getADModule){
$compAdSite = Get-ADComputerSite
$compAdSite | Out-File -FilePath $tempPath\ad_site.txt -Force
$compAdSite | Out-File -FilePath $dirPath\ad_site.txt -Force
} Elseif ($getADModule){
$getCompAdSite = Get-ADReplicationSite -Properties Name
$compAdSite = $getCompAdSite.Name
$compAdSite | Out-File -FilePath $tempPath\ad_site.txt -Force
$compAdSite | Out-File -FilePath $dirPath\ad_site.txt -Force
}

$adSite = Get-Content C:\temp\ad_site.txt
$adSite = Get-Content "C:\Scripts\Add-ADSitePrinters\ad_site.txt"
$siteFileCheck = Test-Path "C:\Scripts\Add-ADSitePrinters\ad_site.txt"

Switch ($compAdSite) {
"Site 1" { $printServer = Get-Printer -ComputerName "server1.domain.com" | Where-Object {$_.Name -notlike "*OLD" -and $_.Name -notlike "*Zebra*" -and $_.Published -eq $true} }
Expand All @@ -76,6 +77,9 @@ If ($adSite -notmatch $compAdSite) {
}
Write-Output "Unmapped`: $($getNonLocalPrinters.Name)"
$getNonLocalPrinters | Remove-Printer
} Elseif (!$adSite -or $siteFileCheck) {
Write-Output "The text file to compare the current AD site to previous AD site does not exist, no printers removed or mapped."
Continue
}

Write-Output "Adding any unmapped local campus printers"
Expand Down
18 changes: 18 additions & 0 deletions Client Configuration/Set-PoShProfileCustomizations.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<#
.PURPOSE
Script to setup my PowerShell cusotmizations on new machines.
.LINKS
.TODO
.NOTES
Created By: Justin Grathwohl
Date Created:
Date Updated:
#>

winget install JanDeDobbeleer.OhMyPosh -s winget
oh-my-posh init pwsh --config "https://raw.githubusercontent.com/JanDeDobbeleer/oh-my-posh/main/themes/night-owl.omp.json" | Invoke-Expression
. $PROFILE
Empty file.

0 comments on commit 62ffac2

Please sign in to comment.