Skip to content

Commit

Permalink
Fixing issue with scoping.
Browse files Browse the repository at this point in the history
  • Loading branch information
adamdriscoll committed May 19, 2020
1 parent e2df8f5 commit 220d726
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 10 deletions.
11 changes: 2 additions & 9 deletions src/v2/Scripts/grid.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ function New-UDGrid {
[Parameter()]
[Switch]$NoFilter,
[Parameter(Mandatory)]
[object]$Endpoint,
[Endpoint]$Endpoint,
[Parameter()]
[object[]]$ArgumentList,
[Parameter()]
Expand All @@ -44,14 +44,7 @@ function New-UDGrid {

End {

if ($null -ne $Endpoint) {
if ($Endpoint -is [scriptblock]) {
$Endpoint = New-UDEndpoint -Endpoint $Endpoint -Id $Id -ArgumentList $ArgumentList
}
elseif ($Endpoint -isnot [UniversalDashboard.Models.Endpoint]) {
throw "Endpoint must be a script block or UDEndpoint"
}
}
$Endpoint.Register($Id, $PSCmdlet)

@{
type = 'ud-grid'
Expand Down
2 changes: 1 addition & 1 deletion src/v2/Scripts/page.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ function New-UDPage
}

[array]$c = @()
if ($Content) { [array]$c = & $Content}
if ($Content) { [array]$c = . $Content}

@{
name = $Name
Expand Down

0 comments on commit 220d726

Please sign in to comment.