File tree Expand file tree Collapse file tree 1 file changed +10
-1
lines changed Expand file tree Collapse file tree 1 file changed +10
-1
lines changed Original file line number Diff line number Diff line change 9
9
10
10
)
11
11
12
+ # Check if the script is running under a Windows service account (SYSTEM, NETWORK SERVICE, LOCAL SERVICE)
13
+ $serviceAccounts = @ (' SYSTEM' , ' NETWORK SERVICE' , ' LOCAL SERVICE' )
14
+ $currentUser = [System.Security.Principal.WindowsIdentity ]::GetCurrent().Name
15
+ if ($serviceAccounts | Where-Object { $currentUser -match $_ }) {
16
+ Write-Warning " Warning: This script is running under a Windows service account ($currentUser ). Microsoft Access should not be executed as a service!"
17
+ }
18
+
12
19
[string ]$tempFileName = " VcsBuildTempApp"
13
20
[string ]$accdbFileName = $tempFileName
14
21
if ($FileName -gt " " ) {
28
35
$access.OpenCurrentDatabase ($accdbPath )
29
36
}
30
37
38
+
39
+
40
+
31
41
[string ]$addInProcessPath = " "
32
42
if ($VcsAddInPath -gt " " ) {
33
43
$addInProcessPath = [System.IO.Path ]::ChangeExtension($VcsAddInPath , " " ).TrimEnd(' .' )
@@ -98,7 +108,6 @@ Write-Host ""
98
108
if ( ($builtFileName -gt " " ) -and ($builtFileName -ne " $tempFileName .accdb" ) ) {
99
109
Write-Host " Built: $builtFileName ($builtFilePath )"
100
110
} else {
101
-
102
111
Write-Host " Build failed"
103
112
if ([string ]::IsNullOrEmpty($builtFileName )) {
104
113
Write-Host " (builtFileName is empty)"
You can’t perform that action at this time.
0 commit comments