Open luizlinux opened 5 years ago
Hi , I try also on Linux,(Centos 7) . But it won't work . Maybe it can only work on windows .
Get-Module
ModuleType Version Name ExportedCommands
Manifest 6.1.0.0 Microsoft.PowerShell.Management {Add-Content, Clear-Content, Clear-Item, Clear-ItemProperty…} Manifest 6.1.0.0 Microsoft.PowerShell.Utility {Add-Member, Add-Type, Clear-Variable, Compare-Object…} Script 1.3.2 PackageManagement {Find-Package, Find-PackageProvider, Get-Package, Get-PackageProvider…} Script 2.1.3 PowerShellGet {Find-Command, Find-DscResource, Find-Module, Find-RoleCapability…} Script 2.0.0 PSReadLine {Get-PSReadLineKeyHandler, Get-PSReadLineOption, Remove-PSReadLineKeyHandler, Set-PSReadLineKeyHan… Script 6.7.0.148… VMware.Vim Script 11.5.0.14… VMware.VimAutomation.Cis.Core {Connect-CisServer, Disconnect-CisServer, Get-CisService} Script 11.5.0.14… VMware.VimAutomation.Common {Get-Task, Stop-Task, Wait-Task} Script 11.5.0.14… VMware.VimAutomation.Core {Add-PassthroughDevice, Add-VirtualSwitchPhysicalNetworkAdapter, Add-VMHost, Add-VMHostNtpServer…} Script 11.5.0.14… VMware.VimAutomation.Sdk {Get-ErrorReport, Get-InstallPath, Get-PSVersion}
$PSVersionTable
Name Value
PSVersion 6.2.3 PSEdition Core GitCommitId 6.2.3 OS Linux 3.10.0-1062.4.1.el7.x86_64 #1 SMP Fri Oct 18 17:15:30 UTC 2019 Platform Unix PSCompatibleVersions {1.0, 2.0, 3.0, 4.0…} PSRemotingProtocolVersion 2.3 SerializationVersion 1.1.0.1 WSManStackVersion 3.0
error ./vCheck.ps1 -config You cannot call a method on a null-valued expression. At /home/vCheck/vCheck-vSphere-master/vCheck.ps1:833 char:2
I try on windows mashine and it's work.
I have also the same problem running powershell on linux and vCheck.ps1 script. I think that it is a great script and I would like to know if I can use it on Linux (centos 7.8, powershell 7.1, latest version of vCheck.ps1) Thank you
Since PowerCLI 12.0 a number of PowerCLI modules (License, vROps) and the Open-VmConsoleWindow cmdlet have been ported to Linux and macOS. There are still a few modules (VumAutomation) and cmdlets (ViCredentialStore, VMHostHardware) left that are not yet ported or can not be ported.
The original problem this issue reported upon (License) is resolved, provided you install PowerCLI 12.0 (or later) on the Linux box. One caveat, it needs to be of course a Linux platform on which PSv7 is supported.
Dear Lucd,
thank you for your help. I installed PowerCLI 12.0 and PSv7.1 and vCheck script started.
Anyway I received this first error
InvalidOperation: /root/vCheck-vSphere/vCheck.ps1:833
Line |
833 | ($lang.GetEnumerator() | Where-Object { $_.Name -match "setupMsg[
| ~~~~~~~~~~~~~
| You cannot call a method on a null-valued expression.
and a lot of error messages similar to the following ones:
Write-Warning: /root/vCheck-vSphere/vCheck.ps1:885
Line |
885 | Write-Warning -Message $lang.pluginBegin
| ~~~~~
| Cannot bind argument to parameter 'Message' because it is null.
Write-Progress: /root/vCheck-vSphere/vCheck.ps1:895
Line |
895 | Write-Progress -ID 1 -Activity $lang.pluginActivity -Status $ …
| ~~~~
| Cannot bind argument to parameter 'Activity' because it is null.
Write-Progress: /root/vCheck-vSphere/Plugins/60 VM/79 Find VMs in Uncontrolled Snapshot Mode.ps1:26
Line |
26 | … ity -Status ($pLang.pluginStatus -f $i, $Datastores.count, $eachDS.Na …
| ~~~~~~~~~~~~~
| Cannot validate argument on parameter 'Status'. The argument is null or empty. Provide an argument that is not null or empty, and then try the command again.
At the end of the script execution a mail has been sent as expected, but I would like to know if I can fix these errors.
Last question: do you know why when I write command from PWSH I see this extra characters added $<5> to the execution string?
Thank you in advance. Regards, Mauro
On 2 Dec 2020, at 17:38, LucD notifications@github.com wrote:
Since PowerCLI 12.0 a number of PowerCLI modules (License, vROps) and the Open-VmConsoleWindow cmdlet have been ported to Linux and macOS. There are still a few modules (VumAutomation) and cmdlets (ViCredentialStore, VMHostHardware) left that are not yet ported or can not be ported.
The original problem this issue reported upon (License) is resolved, provided you install PowerCLI 12.0 (or later) on the Linux box. One caveat, it needs to be of course a Linux platform on which PSv7 is supported.
— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/alanrenouf/vCheck-vSphere/issues/679#issuecomment-737349130, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABZVEN7HOYNLJZY3NJEEDBDSSZUPFANCNFSM4HNFCVOA.
Mauro Tridici
Fondazione CMCC CMCC Supercomputing Center presso Complesso Ecotekne - Università del Salento - Strada Prov.le Lecce - Monteroni sn 73100 Lecce IT http://www.cmcc.it
mobile: (+39) 327 5630841 email: mauro.tridici@cmcc.it https://it.linkedin.com/in/mauro-tridici-5977238b
Le informazioni contenute in questo messaggio di posta elettronica e negli allegati se presenti sono riservate e confidenziali: ne è vietata la diffusione in qualsiasi modo o forma (GDPR 2016/679).
Qualora lei non fosse il destinatario del messaggio, la invito a non diffonderlo e ad eliminarlo dandone gentilmente comunicazione al mittente.
The information included in this e-mail and any attachments are confidential and may also be privileged (GDPR 2016/679).
If you are not the correct recipient, you are kindly requested to notify the sender immediately, to cancel it and not disclose the contents to any other person.
Do you have a Lang folder under the vCheck-vSphere folder? I suspect the issue you reported on comes from the following lines in vCheck.ps1.
################################################################################
# Internationalization #
################################################################################
# Default language en-US
Import-LocalizedData -BaseDirectory ($ScriptPath + '\lang') -BindingVariable lang -UICulture en-US -ErrorAction SilentlyContinue
# Override the default (en-US) if it exists in lang directory
Import-LocalizedData -BaseDirectory ($ScriptPath + "\lang") -BindingVariable lang -ErrorAction SilentlyContinue
You could try that import without the ErrorAction parameter. That should clarify what the error is.
Can you show an example of
do you know why when I write command from PWSH I see this extra characters added $<5> to the execution string?
Thank you for your suggestion. The error was in Lang directory path in a Linux environment.
I changed the lines in:
################################################################################
################################################################################
Import-LocalizedData -BaseDirectory ($ScriptPath + '/Lang') -BindingVariable lang -UICulture en-US -ErrorAction SilentlyContinue
Import-LocalizedData -BaseDirectory ($ScriptPath + "/Lang") -BindingVariable lang -ErrorAction SilentlyContinue
and now it seems to be working. Do you have some suggestions about this last error?
Write-Progress: /root/vCheck-vSphere/Plugins/60 VM/79 Find VMs in Uncontrolled Snapshot Mode.ps1:26
Line |
26 | … ity -Status ($pLang.pluginStatus -f $i, $Datastores.count, $eachDS.Na …
| ~~~~~~~~~~~~~
| Cannot validate argument on parameter 'Status'. The argument is null or empty. Provide an argument that is not null or empty, and then try the
| command again.
Many thanks, Mauro
On 2 Dec 2020, at 18:55, LucD notifications@github.com wrote:
Do you have a Lang folder under the vCheck-vSphere folder? I suspect the issue you reported on comes from the following lines in vCheck.ps1.
################################################################################
Internationalization
################################################################################
Default language en-US
Import-LocalizedData -BaseDirectory ($ScriptPath + '\lang') -BindingVariable lang -UICulture en-US -ErrorAction SilentlyContinue
Override the default (en-US) if it exists in lang directory
Import-LocalizedData -BaseDirectory ($ScriptPath + "\lang") -BindingVariable lang -ErrorAction SilentlyContinue You could try that import without the ErrorAction parameter. That should clarify what the error is.
— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/alanrenouf/vCheck-vSphere/issues/679#issuecomment-737394759, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABZVEN6TCNMLDNDANZHFNZ3SSZ5RZANCNFSM4HNFCVOA.
Mauro Tridici
Fondazione CMCC CMCC Supercomputing Center presso Complesso Ecotekne - Università del Salento - Strada Prov.le Lecce - Monteroni sn 73100 Lecce IT http://www.cmcc.it
mobile: (+39) 327 5630841 email: mauro.tridici@cmcc.it https://it.linkedin.com/in/mauro-tridici-5977238b
Le informazioni contenute in questo messaggio di posta elettronica e negli allegati se presenti sono riservate e confidenziali: ne è vietata la diffusione in qualsiasi modo o forma (GDPR 2016/679).
Qualora lei non fosse il destinatario del messaggio, la invito a non diffonderlo e ad eliminarlo dandone gentilmente comunicazione al mittente.
The information included in this e-mail and any attachments are confidential and may also be privileged (GDPR 2016/679).
If you are not the correct recipient, you are kindly requested to notify the sender immediately, to cancel it and not disclose the contents to any other person.
That plugin (79) also contains Import-LocalizedData lines. Did you correct the paths on those as well?
I solved the issue. The extra characters you can see in the picture below were related to my “Terminal” configuration.
Thank you, Mauro
On 2 Dec 2020, at 18:56, LucD notifications@github.com wrote:
Can you show an example of
do you know why when I write command from PWSH I see this extra characters added $<5> to the execution string?
— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/alanrenouf/vCheck-vSphere/issues/679#issuecomment-737395430, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABZVENYBSIZYW3AHD3PVVA3SSZ5VXANCNFSM4HNFCVOA.
Mauro Tridici
Fondazione CMCC CMCC Supercomputing Center presso Complesso Ecotekne - Università del Salento - Strada Prov.le Lecce - Monteroni sn 73100 Lecce IT http://www.cmcc.it
mobile: (+39) 327 5630841 email: mauro.tridici@cmcc.it https://it.linkedin.com/in/mauro-tridici-5977238b
Le informazioni contenute in questo messaggio di posta elettronica e negli allegati se presenti sono riservate e confidenziali: ne è vietata la diffusione in qualsiasi modo o forma (GDPR 2016/679).
Qualora lei non fosse il destinatario del messaggio, la invito a non diffonderlo e ad eliminarlo dandone gentilmente comunicazione al mittente.
The information included in this e-mail and any attachments are confidential and may also be privileged (GDPR 2016/679).
If you are not the correct recipient, you are kindly requested to notify the sender immediately, to cancel it and not disclose the contents to any other person.
Ok, many many thanks. I will fix the paths
Thank you for your patience. Mauro
On 2 Dec 2020, at 20:26, LucD notifications@github.com wrote:
That plugin (79) also contains Import-LocalizedData lines. Did you correct the paths on those as well?
— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/alanrenouf/vCheck-vSphere/issues/679#issuecomment-737445030, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABZVEN7S46GJHQWUP57LWZDSS2IHNANCNFSM4HNFCVOA.
Mauro Tridici
Fondazione CMCC CMCC Supercomputing Center presso Complesso Ecotekne - Università del Salento - Strada Prov.le Lecce - Monteroni sn 73100 Lecce IT http://www.cmcc.it
mobile: (+39) 327 5630841 email: mauro.tridici@cmcc.it https://it.linkedin.com/in/mauro-tridici-5977238b
Le informazioni contenute in questo messaggio di posta elettronica e negli allegati se presenti sono riservate e confidenziali: ne è vietata la diffusione in qualsiasi modo o forma (GDPR 2016/679).
Qualora lei non fosse il destinatario del messaggio, la invito a non diffonderlo e ad eliminarlo dandone gentilmente comunicazione al mittente.
The information included in this e-mail and any attachments are confidential and may also be privileged (GDPR 2016/679).
If you are not the correct recipient, you are kindly requested to notify the sender immediately, to cancel it and not disclose the contents to any other person.
Dear Lucd,
Alans vCheck script is working absolutely fine for me on centos.
But when I schedule cron for the Check script it fails and the script does not run.
Can you please suggest what can be done to schedule the vCheck script on Centos.
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 vCheck script & it failed.
Please suggest.
I'm using Alans vCheck script version 6.25 on centos 7.8 Powershell version 7.1.0
I can't get to work on Linux (Debian 11 - 5.10.0-14-amd64 + Powershell 7.2.4) I don't have the Get-PSSnapin cmdlet available! What can I do? Thanks in advance.
Hi guys.
Nowhere on the README.md is stated that Linux is not supported, so I'm assuming that as long as I have Powershell and PowerCLI properly configured and working the script should be OS agnostic.
However it fails to run on Linux.
What am I doing wrong?