File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -48,12 +48,13 @@ try {
4848 $appJson = Invoke-ScriptInBcContainer - containerName $containerName - scriptblock { Param ($appFile )
4949 Get-NavAppInfo - Path $appFile | ConvertTo-Json - Depth 99
5050 } - argumentList (Get-BcContainerPath - containerName $containerName - path $destFile ) | ConvertFrom-Json
51- # Remove-Item -Path $destFile
51+ Remove-Item - Path $destFile
52+ $appJson.Version = " $ ( $appJson.Version.Major ) .$ ( $appJson.Version.Minor ) .$ ( $appJson.Version.Build ) .$ ( $appJson.Version.Revision ) "
5253 $appJson | Add-Member - NotePropertyName ' Id' - NotePropertyValue $appJson.AppId.Value
5354 if ($appJson.Dependencies ) {
54- $appJson.Dependencies | % { if ($_ ) {
55+ $appJson.Dependencies | ForEach-Object { if ($_ ) {
5556 $_ | Add-Member - NotePropertyName ' Id' - NotePropertyValue $_.AppId
56- $_ | Add-Member - NotePropertyName ' Version' - NotePropertyValue $ _.MinVersion.ToString ()
57+ $_ | Add-Member - NotePropertyName ' Version' - NotePropertyValue " $ ( $ _.MinVersion.Major ) . $ ( $_ .MinVersion.Minor ) . $ ( $_ .MinVersion.Build ) . $ ( $_ .MinVersion.Revision ) "
5758 } }
5859 }
5960 }
Original file line number Diff line number Diff line change 66#>
77function invoke-gh {
88 Param (
9+ [parameter (mandatory = $false , ValueFromPipeline = $true )]
10+ [string ] $inputStr = " " ,
911 [switch ] $silent ,
1012 [switch ] $returnValue ,
1113 [parameter (mandatory = $true , position = 0 )][string ] $command ,
@@ -21,7 +23,7 @@ function invoke-gh {
2123 $arguments += " $_ "
2224 }
2325 }
24- cmdDo - command gh - arguments $arguments - silent:$silent - returnValue:$returnValue
26+ cmdDo - command gh - arguments $arguments - silent:$silent - returnValue:$returnValue - inputStr $inputStr
2527}
2628
2729Export-ModuleMember - Function Invoke-gh
Original file line number Diff line number Diff line change 66#>
77function invoke-git {
88 Param (
9+ [parameter (mandatory = $false , ValueFromPipeline = $true )]
10+ [string ] $inputStr = " " ,
911 [switch ] $silent ,
1012 [switch ] $returnValue ,
1113 [parameter (mandatory = $true , position = 0 )][string ] $command ,
@@ -21,6 +23,6 @@ function invoke-git {
2123 $arguments += " $_ "
2224 }
2325 }
24- cmdDo - command git - arguments $arguments - silent:$silent - returnValue:$returnValue
26+ cmdDo - command git - arguments $arguments - silent:$silent - returnValue:$returnValue - inputStr $inputStr
2527}
2628Export-ModuleMember - Function Invoke-git
Original file line number Diff line number Diff line change @@ -75,7 +75,8 @@ function CmdDo {
7575 [string ] $command = " " ,
7676 [string ] $arguments = " " ,
7777 [switch ] $silent ,
78- [switch ] $returnValue
78+ [switch ] $returnValue ,
79+ [string ] $inputStr = " "
7980 )
8081
8182 $oldNoColor = " $env: NO_COLOR "
@@ -88,6 +89,9 @@ function CmdDo {
8889 $pinfo.FileName = $command
8990 $pinfo.RedirectStandardError = $true
9091 $pinfo.RedirectStandardOutput = $true
92+ if ($inputStr ) {
93+ $pinfo.RedirectStandardInput = $true
94+ }
9195 $pinfo.WorkingDirectory = Get-Location
9296 $pinfo.UseShellExecute = $false
9397 $pinfo.Arguments = $arguments
@@ -96,7 +100,10 @@ function CmdDo {
96100 $p = New-Object System.Diagnostics.Process
97101 $p.StartInfo = $pinfo
98102 $p.Start () | Out-Null
99-
103+ if ($inputStr ) {
104+ $p.StandardInput.WriteLine ($inputStr )
105+ $p.StandardInput.Close ()
106+ }
100107 $outtask = $p.StandardOutput.ReadToEndAsync ()
101108 $errtask = $p.StandardError.ReadToEndAsync ()
102109 $p.WaitForExit ();
You can’t perform that action at this time.
0 commit comments