Here is a barebones code of what I am trying to achieve..
$destinationDir = "subdir1"
#creating tab
$newTab = $psise.PowerShellTabs.Add()
Do
{sleep -m 100}
While (!$newTab.CanInvoke)
#running required script in tab
$newTab.Invoke({ cd $destinationDir})
Since $destinationDir is initialized in the parent tab, its scope is limited to it and I get the following error in the child tab
cd : Cannot process argument because the value of argument "path" is null. Change the value of argument "path" to a non-null value.
How do I overcome this and use the value in the child tab?