Additional Script Updates

This commit is contained in:
Andrew Amason
2025-05-19 15:19:36 -04:00
parent ec2b22290a
commit 9c8438d7d1
136 changed files with 1595 additions and 0 deletions

View File

@@ -0,0 +1,8 @@
# Check if a specific file exists
$filePath = "C:\Company\Compliance\requiredfile.txt"
if (Test-Path $filePath) {
Write-Output "Compliance file is present."
} else {
Write-Output "Compliance file is missing."
}

View File

@@ -0,0 +1,14 @@
# Ensure the specific file is in place
$filePath = "C:\Company\Compliance\requiredfile.txt"
$fileContent = "This is a required compliance file."
if (-Not (Test-Path $filePath)) {
# Create the directory if it doesn't exist
$directoryPath = [System.IO.Path]::GetDirectoryName($filePath)
if (-Not (Test-Path $directoryPath)) {
New-Item -Path $directoryPath -ItemType Directory -Force | Out-Null
}
# Create the file with the required content
New-Item -Path $filePath -ItemType File -Force | Out-Null
Set-Content -Path $filePath -Value $fileContent
}