Product: PowerShell Universal
Version: 5.6.7
Hi everyone,
can someone tell me how I can use the PSU App to transfer UNC paths (FullName) into a table via a New-UDForm? When I use the command Get-ChildItem -Path "\\server\sharename" -Directory, I always get the message that the path does not exist.
Additionally, when passing the path, it gets truncated, even though the variable I want to use shows the correct entry when I output it with Show-UDToast -Message.
New-UDApp -Title 'Test' -Content {
$Session:FormResult = $null
New-UDCard -Content {
New-UDForm -Id 'form1' -Content {
New-UDTextbox -Id 'txtBox1' -Label "UNC-Path" -FullWidth
New-UDSelect -Label 'Choose depth' -Id 'DepthSelect' -Option {
New-UDSelectOption -Name "1. depth" -Value 0
New-UDSelectOption -Name "2. depth" -Value 1
New-UDSelectOption -Name "3. depth" -Value 2
New-UDSelectOption -Name "4. depth" -Value 3
} -FullWidth
} -OnSubmit {
$Session:FormResult = @{
UNCPath = $EventData.txtBox1
Depth = $EventData.DepthSelect
}
Sync-UDElement -Id 'ResultCard'
}
}
New-UDDynamic -Id 'ResultCard' -Content {
if ($Session:FormResult){
$UNCPath = $Session:FormResult.UNCPath
$Depth = $Session:FormResult.Depth
}
$Folders = Get-ChildItem -Path $UNCPath -Depth $Depth -Directory
}