<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Test-Path in Microsoft Virtualization Discussions</title>
    <link>https://community.netapp.com/t5/Microsoft-Virtualization-Discussions/Test-Path/m-p/163255#M6324</link>
    <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Hope you can help.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I want to get the IP address of a SVM's cifs lif into a variable and use this variable in Test-Path, but I can't work out what's happening:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;$newshare = share_test
$activevserverip = Get-NcNetInterface -Vserver $activevserver -DataProtocols cifs | Select-Object Address

PS C:\Windows\system32&amp;gt; $activevserverip

Address 
------- 
xxx.xxx.21.10

Test-Path "\\$activevserverip\$newshare" -verbose

False&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I receive a 'false' even though I know the path is up and accessible. What am I doing wrong please? Is it something like the data type of the IP address? If I create a path variable the IP address details are enclosed in a hash table (?). How can I reduce it to just the IP address?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;PS C:\Windows\system32&amp;gt; $path = "\\$activevserverip\$newshare"

PS C:\Windows\system32&amp;gt; $path
\\@{Address=xxx.xxx.21.10}\share_test&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Sorry if this is basic&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;</description>
    <pubDate>Wed, 04 Jun 2025 10:37:26 GMT</pubDate>
    <dc:creator>tyrone_owen_1</dc:creator>
    <dc:date>2025-06-04T10:37:26Z</dc:date>
    <item>
      <title>Test-Path</title>
      <link>https://community.netapp.com/t5/Microsoft-Virtualization-Discussions/Test-Path/m-p/163255#M6324</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Hope you can help.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I want to get the IP address of a SVM's cifs lif into a variable and use this variable in Test-Path, but I can't work out what's happening:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;$newshare = share_test
$activevserverip = Get-NcNetInterface -Vserver $activevserver -DataProtocols cifs | Select-Object Address

PS C:\Windows\system32&amp;gt; $activevserverip

Address 
------- 
xxx.xxx.21.10

Test-Path "\\$activevserverip\$newshare" -verbose

False&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I receive a 'false' even though I know the path is up and accessible. What am I doing wrong please? Is it something like the data type of the IP address? If I create a path variable the IP address details are enclosed in a hash table (?). How can I reduce it to just the IP address?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;PS C:\Windows\system32&amp;gt; $path = "\\$activevserverip\$newshare"

PS C:\Windows\system32&amp;gt; $path
\\@{Address=xxx.xxx.21.10}\share_test&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Sorry if this is basic&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;</description>
      <pubDate>Wed, 04 Jun 2025 10:37:26 GMT</pubDate>
      <guid>https://community.netapp.com/t5/Microsoft-Virtualization-Discussions/Test-Path/m-p/163255#M6324</guid>
      <dc:creator>tyrone_owen_1</dc:creator>
      <dc:date>2025-06-04T10:37:26Z</dc:date>
    </item>
    <item>
      <title>Re: Test-Path</title>
      <link>https://community.netapp.com/t5/Microsoft-Virtualization-Discussions/Test-Path/m-p/163258#M6325</link>
      <description>&lt;P&gt;Use as&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;Test-Path "\\$($activevserverip.address)\$newshare" -verbose&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 24 Jan 2021 21:48:18 GMT</pubDate>
      <guid>https://community.netapp.com/t5/Microsoft-Virtualization-Discussions/Test-Path/m-p/163258#M6325</guid>
      <dc:creator>GidonMarcus</dc:creator>
      <dc:date>2021-01-24T21:48:18Z</dc:date>
    </item>
    <item>
      <title>Re: Test-Path</title>
      <link>https://community.netapp.com/t5/Microsoft-Virtualization-Discussions/Test-Path/m-p/163262#M6326</link>
      <description>&lt;P&gt;Brilliant, thank you.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I can see why that works, however I'm not sure why the below doesn't filter down to just the address:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;&amp;gt;$activevserverip = Get-NcNetInterface -Vserver $activevserver -DataProtocols cifs | Select-Object Address

&amp;gt;activevserverip

Address 
------- 
10.4.0.9&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any links that you could share which would explain this please?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks again&lt;/P&gt;</description>
      <pubDate>Mon, 25 Jan 2021 07:43:51 GMT</pubDate>
      <guid>https://community.netapp.com/t5/Microsoft-Virtualization-Discussions/Test-Path/m-p/163262#M6326</guid>
      <dc:creator>tyrone_owen_1</dc:creator>
      <dc:date>2021-01-25T07:43:51Z</dc:date>
    </item>
    <item>
      <title>Re: Test-Path</title>
      <link>https://community.netapp.com/t5/Microsoft-Virtualization-Discussions/Test-Path/m-p/163285#M6328</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;As in the example below you can get the type by piping the output to GM (get-member).&lt;/P&gt;&lt;P&gt;With using only the "select" - you still have it in a structured data type (in my get-disk example below "Selected.Microso...."), As test-parh don't know this odd data-type ,&amp;nbsp; you have to extract it into a format it expects (can see in get-help test-path it expects a string).&amp;nbsp;&lt;/P&gt;&lt;P&gt;PS C:\Users\g&amp;gt; get-help Test-Path&lt;/P&gt;&lt;P&gt;NAME&lt;BR /&gt;Test-Path&lt;/P&gt;&lt;P&gt;SYNTAX&lt;BR /&gt;Test-Path [-Path] &lt;U&gt;&lt;STRONG&gt;&amp;lt;string[]&amp;gt;&lt;/STRONG&gt; &lt;/U&gt;[-Filter &amp;lt;string&amp;gt;]..........&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;PS C:\Users\g&amp;gt; Get-Disk | select FriendlyName | gm&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;STRONG&gt;&lt;U&gt;TypeName: Selected.Microsoft.Management.Infrastructure.CimInstance&lt;/U&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;Name MemberType Definition&lt;BR /&gt;---- ---------- ----------&lt;BR /&gt;Equals Method bool Equals(System.Object obj)&lt;BR /&gt;GetHashCode Method int GetHashCode()&lt;BR /&gt;GetType Method type GetType()&lt;BR /&gt;ToString Method string ToString()&lt;BR /&gt;FriendlyName NoteProperty string FriendlyName=INTEL SSDSC2BF180A5L&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;PS C:\Users\g&amp;gt; (Get-Disk).FriendlyName&lt;BR /&gt;INTEL SSDSC2BF180A5L&lt;BR /&gt;PS C:\Users\g&amp;gt; (Get-Disk).FriendlyName | gm&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;TypeName: &lt;STRONG&gt;&lt;U&gt;System.String&lt;/U&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;Name MemberType Definition&lt;BR /&gt;---- ---------- ----------&lt;BR /&gt;Clone Method System.Object Clone(), System.Object ICloneable.Clone()&lt;/P&gt;&lt;P&gt;.......&lt;/P&gt;</description>
      <pubDate>Mon, 25 Jan 2021 15:22:59 GMT</pubDate>
      <guid>https://community.netapp.com/t5/Microsoft-Virtualization-Discussions/Test-Path/m-p/163285#M6328</guid>
      <dc:creator>GidonMarcus</dc:creator>
      <dc:date>2021-01-25T15:22:59Z</dc:date>
    </item>
    <item>
      <title>Re: Test-Path</title>
      <link>https://community.netapp.com/t5/Microsoft-Virtualization-Discussions/Test-Path/m-p/163294#M6329</link>
      <description>&lt;P&gt;Thanks for the additional info - very helpful&lt;/P&gt;</description>
      <pubDate>Mon, 25 Jan 2021 16:46:08 GMT</pubDate>
      <guid>https://community.netapp.com/t5/Microsoft-Virtualization-Discussions/Test-Path/m-p/163294#M6329</guid>
      <dc:creator>tyrone_owen_1</dc:creator>
      <dc:date>2021-01-25T16:46:08Z</dc:date>
    </item>
  </channel>
</rss>

