0

I have the problem when I try to excecute file 3 (auth_test2.ps1), then I get the error-message (and the output):

AuthorizationManager check failed.
At C:\Users\systemCESCH\Documents\Workspace.\auth_test1.ps1:2 char:2
+ . <<<<  ($thisScript + '.\auth_test0.ps1')
    + CategoryInfo          : NotSpecified: (:) [], PSSecurityException
    + FullyQualifiedErrorId : RuntimeException

auth_test1
auth_test2

File 1 (auth_test0.ps1):

Write-Host "auth_test0"

File 2 (auth_test1.ps1):

$thisScript = Split-Path -Path $MyInvocation.MyCommand.Definition -Parent
. ($thisScript + '.\auth_test0.ps1')

Write-Host "auth_test1"

File 3 (auth_test2.ps1):

$thisScript = Split-Path -Path $MyInvocation.MyCommand.Definition -Parent
. ($thisScript + '.\auth_test1.ps1')

Write-Host "auth_test2"

The "ExecutionPolicy" is "RemoteSigned", "Unrestricted" makes no difference... I hope someone can help me solve the problem.

Dobi
  • 125
  • 5
  • 15
  • Only auth_test2.ps1 fails? Are these files in the same folder? Did you try launching as administrator? – Neil Sep 26 '14 at 10:41
  • Yes, I opened it as admin. Yes only the "auth_test2.ps1" fails. (Btw., if I create a file auth_test3.ps1, which does the same than 1 an 2 it fails to.) – Dobi Sep 26 '14 at 10:46
  • Perhaps nesting isn't allowed. Though it strikes me as odd. You could try the inverse, making 1 refer to 2, which if nesting isn't allowed, would make 1 break, and not 2. I wish I could help you more than that. – Neil Sep 26 '14 at 11:14
  • [This](http://tgnp.me/2011/09/powershell-authorizationmanager-check-failed-resolution/) refers to scenarios that could cause this to happen. _Check to make sure Windows Management Instrumentation service (WMI) is Enabled and running. If it’s disabled, try enabling it and starting it to see if that clears the error._ – Matt Sep 26 '14 at 12:48
  • I changed the code that I have a "Main" file where I include all the other files instead that one file includes the next one. No more problem. – Dobi Sep 29 '14 at 08:25

0 Answers0