AL/New-ALAppDependency.ps1
function New-ALAppDependency { Param( [Parameter(Mandatory=$false)] [string]$SourcePath = (Get-Location), [Parameter(Mandatory=$true)] [guid]$Id, [Parameter(Mandatory=$true)] [string]$Name, [Parameter(Mandatory=$true)] [string]$Publisher, [Parameter(Mandatory=$true)] [string]$Version ) $Dependency = New-Object PSObject $Dependency | Add-Member -MemberType NoteProperty -Name appId -Value $Id $Dependency | Add-Member -MemberType NoteProperty -Name name -Value $Name $Dependency | Add-Member -MemberType NoteProperty -Name publisher -Value $Publisher $Dependency | Add-Member -MemberType NoteProperty -Name version -Value $Version $AppJson = Get-Content (Join-Path $SourcePath 'app.json') -Raw | ConvertFrom-Json $AppJson.dependencies += $Dependency Set-Content (Join-Path $SourcePath 'app.json') (ConvertTo-Json $AppJson) } Export-ModuleMember -Function New-ALAppDependency |