Compare commits
5
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
44dc665779 | ||
|
|
ac539facb0 | ||
|
|
0224669186 | ||
|
|
6d306dcaf2 | ||
|
|
a666d2e6a5 |
@@ -59,6 +59,15 @@ If ( IsAdmin )
|
||||
Catch { LogErr $_.Exception.Message }
|
||||
}
|
||||
}
|
||||
|
||||
## Remove AutoCAD temp files
|
||||
If (-not (IsRunning -Name "acad") ) {
|
||||
$AutoCADTempFiles = Get-ChildItem -Path "${Env:SystemDrive}\Users" | Where-Object { $_.PSIsContainer -eq $true } | ForEach-Object { Get-ChildItem -Path $($_.FullName + "\AppData\Local\Temp\*") -File -Include '*.ac$' -ErrorAction SilentlyContinue }
|
||||
If ( $AutoCADTempFiles ) {
|
||||
LogMsg "Deleting AutoCAD temp files for all users"
|
||||
ForEach ( $tempfile in $AutoCADTempFiles ) { Remove-Item $tempfile -Force -ErrorAction SilentlyContinue }
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
## Only run this section if we don't have administrative privileges
|
||||
@@ -73,4 +82,13 @@ Else
|
||||
LogMsg "Deleting all temp files not modified in ${OlderThan} day(s) from ${Env:TEMP}"
|
||||
ForEach ( $OldTempFile in $OldTempFiles ) { Remove-Item $OldTempFile -Force -Recurse -ErrorAction SilentlyContinue }
|
||||
}
|
||||
|
||||
## Remove AutoCAD temp files
|
||||
If (-not (IsRunning -Name "acad") ) {
|
||||
$AutoCADTempFiles = Get-ChildItem -Path "${Env:TEMP}\*" -File -Include '*.ac$' -ErrorAction SilentlyContinue
|
||||
If ( $AutoCADTempFiles ) {
|
||||
LogMsg "Deleting AutoCAD temp files"
|
||||
ForEach ( $tempfile in $AutoCADTempFiles ) { Remove-Item $tempfile -Force -ErrorAction SilentlyContinue }
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,13 @@
|
||||
@echo off
|
||||
|
||||
set DriveLetter={[DriveLetter]}
|
||||
set ServerShare={[ServerShare]}
|
||||
set Persistent={[Persistent]}
|
||||
set ShareUser={[ShareUser]}
|
||||
set SharePass={[SharePass]}
|
||||
|
||||
net use %DriveLetter% /d /y
|
||||
|
||||
net use %DriveLetter% %ServerShare% /persistent:%Persistent% /user:%ShareUser% %SharePass%
|
||||
|
||||
net use
|
||||
@@ -0,0 +1,2 @@
|
||||
@echo off
|
||||
REG ADD "HKCU\Software\Microsoft\Exchange\Exchange Provider" /v DisableGALPhonetic /t REG_DWORD /d 1 /f
|
||||
@@ -0,0 +1,2 @@
|
||||
@echo off
|
||||
net use
|
||||
@@ -603,5 +603,11 @@ function Get-LiquidFilesCLI {
|
||||
Return $exe_path
|
||||
}
|
||||
|
||||
# Function to determine if an app is running
|
||||
function IsRunning ([Parameter(ValueFromPipeline=$true)][string]$Name) {
|
||||
$RunningInstances = Get-Process | Where { $_.Name -ilike $Name }
|
||||
If ( $RunningInstances ) { Return $true } Else { Return $false }
|
||||
}
|
||||
|
||||
Setup-MSPDirectories
|
||||
Setup-LogFile
|
||||
Reference in New Issue
Block a user