TheRagnarok
New Member
Hello everyone
I have a PowerShell script that is working absolutely fine when we run manually on centos. (Enter PWSH shell and run the script)
But when I schedule cron for the vCheck script it fails and the script does not run.
Can anyone please suggest what can be done to schedule the vCheck script on Centos?(FYI this PowerShell script calls multiple other Powershell scripts )
Things I have tried so far.
Running the script & scheduling as /usr/bin/pwsh/ /path/to/vCheck.ps1 & this did not work
Setting the user's shell to pwsh and then scheduling the script but did not work.
Tried to mention environment variables in the vCheck script & it failed.
Here are my current environment variables that I have tried so far
[Server~]$ echo $PATH
/opt/microsoft/powershell/7:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin
[Server~]$
[Server ~]$ echo $PATH
/opt/microsoft/powershell/7:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/root/bin:/usr/bin/pwsh:/opt/microsoft/powershell/7/pwsh:/opt/microsoft/powershell/7/pwsh.dll:/opt/microsoft/powershell/7/pwsh.pdb:/opt/microsoft/powershell/7/pwsh.xml
[Server ~]$
Please suggest.
I'm using Alans vCheck script version 6.25 on centos 7.8 Powershell version 7.1.0
Thanks in advance
I have a PowerShell script that is working absolutely fine when we run manually on centos. (Enter PWSH shell and run the script)
But when I schedule cron for the vCheck script it fails and the script does not run.
Can anyone please suggest what can be done to schedule the vCheck script on Centos?(FYI this PowerShell script calls multiple other Powershell scripts )
Things I have tried so far.
Running the script & scheduling as /usr/bin/pwsh/ /path/to/vCheck.ps1 & this did not work
Setting the user's shell to pwsh and then scheduling the script but did not work.
Tried to mention environment variables in the vCheck script & it failed.
Here are my current environment variables that I have tried so far
[Server~]$ echo $PATH
/opt/microsoft/powershell/7:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin
[Server~]$
[Server ~]$ echo $PATH
/opt/microsoft/powershell/7:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/root/bin:/usr/bin/pwsh:/opt/microsoft/powershell/7/pwsh:/opt/microsoft/powershell/7/pwsh.dll:/opt/microsoft/powershell/7/pwsh.pdb:/opt/microsoft/powershell/7/pwsh.xml
[Server ~]$
Please suggest.
I'm using Alans vCheck script version 6.25 on centos 7.8 Powershell version 7.1.0
Thanks in advance