Active IQ Unified Manager Discussions

WFA Error: adding data sources, cannot perform discovery

ilonak
4,411 Views

Error message is as follows:

 

At C:\Program Files\NetApp\WFA\jboss\standalone\tmp\wfa\storage449372416819909114.ps1:92 char:40

+         doLog $("Failed to write entry to $file: $_ - content is: " + ($line -join  ...

+                                           ~~~~~~
Variable reference is not valid. ':' was not followed by a valid variable name character. Consider using ${} to delimit the name.

 

Where to start troubleshooting this?

1 ACCEPTED SOLUTION

ilonak
4,402 Views

Disregard; this error was due to WFA being installed on Windows Server 2012.  When running on Windows Server 2008 R2, this doesn't happen.  Leaving this here in case someone else needs to find it.

View solution in original post

5 REPLIES 5

ilonak
4,403 Views

Disregard; this error was due to WFA being installed on Windows Server 2012.  When running on Windows Server 2008 R2, this doesn't happen.  Leaving this here in case someone else needs to find it.

sinhaa
4,390 Views

This is happening because Win 2012 has Powershell v3.0 and Windows2008 has Powershell v2.0. WFA supports Poweshell3.0 and windows2012. WFA is supported on Powershell v3.0

 

This particular error is due to Powershell 3.0 variation from v2.0. Colon i.e. : in Powershell is a special character has defines the scope.  A : immediately after a variable ( $file ) is treated as some variable within namespace $file. This wasn't handled well in v2.0, which Microsoft  has fixed in v3.0

 

In your code, $file:  should been written as ${file}: 

 

 

sinhaa 

If this post resolved your issue, help others by selecting ACCEPT AS SOLUTION or adding a KUDO.

sinhaa
4,387 Views

In win2008 with Poshv2.0, it doesn't throw an error but may NOT give the right result. So I suggest you make the correct in the code irrespective of where you want to run it.

 

Consider trying this example below on win 2008 :

###

$file="WFA"

Write-Host " $file: is the name of the file"

 

####

 

Output:

-----

is the name of the file

-----

 

It will NOT throw any error but will also not print the value of $file.  This was a bug which was fixed in Powershellv3.0 which correctly throws the error that you need to use {}.

 

Corect cde will be:

Write-Host " ${file}: is the name of the file"

 

 

 

 

If this post resolved your issue, help others by selecting ACCEPT AS SOLUTION or adding a KUDO.

Marc
4,141 Views

How do we resolve this within WFA though. As the ps1 script appears to be created when it tries to connect to the filer and then automatically removes it after failing so I am unable to edit the script with the correct syntax?

sinhaa
4,107 Views

The ps1 script that gets created during execution is the temporary execution sript and for WFA's own use, WFA users need not touch/modify it. Whatever you want to change, make the change in the Command code/ Data Source Type PoSh code, it will be sufficient.

 

sinhaa

 

 

 

If this post resolved your issue, help others by selecting ACCEPT AS SOLUTION or adding a KUDO.
Public