From 63a36e0df39153497625177c7f127310371e5538 Mon Sep 17 00:00:00 2001 From: Matthias Dittrich Date: Sat, 27 Jun 2020 22:08:49 +0200 Subject: [PATCH 1/6] next release --- RELEASE_NOTES.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/RELEASE_NOTES.md b/RELEASE_NOTES.md index 6a0ce2f3d0f..ea57f1a8535 100644 --- a/RELEASE_NOTES.md +++ b/RELEASE_NOTES.md @@ -1,5 +1,9 @@ # Release Notes +## 5.20.3-alpha - tbd + +* tbd + ## 5.20.2 - 2020-06-27 * ENHANCEMENT: Update bundled paket From 94356f372b13b16e230f59c394fdab93af10d741 Mon Sep 17 00:00:00 2001 From: Faisal Alfaddaghi Date: Sat, 11 Jul 2020 16:47:00 +0300 Subject: [PATCH 2/6] Update Octokit.fsx octokit got updated to work with net46, so the paths need to be updated in order to pick up the dependency. --- modules/Octokit/Octokit.fsx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/modules/Octokit/Octokit.fsx b/modules/Octokit/Octokit.fsx index 2b7237d2292..2338202e4b8 100644 --- a/modules/Octokit/Octokit.fsx +++ b/modules/Octokit/Octokit.fsx @@ -1,8 +1,8 @@ #nowarn "211" #I __SOURCE_DIRECTORY__ -#I @"../../../../../packages/Octokit/lib/net45" -#I @"../../packages/Octokit/lib/net45" -#I @"../../../../../../packages/build/Octokit/lib/net45" +#I @"../../../../../packages/Octokit/lib/net46" +#I @"../../packages/Octokit/lib/net46" +#I @"../../../../../../packages/build/Octokit/lib/net46" #r "System.Net.Http" #r "Octokit.dll" From b59d5bac06ca031062b227a7b0d7ba2047a84c27 Mon Sep 17 00:00:00 2001 From: YazeedObaid Date: Tue, 21 Jul 2020 15:30:27 +0300 Subject: [PATCH 3/6] Add visual studio 2017 & 2019 F# interactive installation paths. --- src/legacy/FakeLib/FSIHelper.fs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/legacy/FakeLib/FSIHelper.fs b/src/legacy/FakeLib/FSIHelper.fs index 9b74b16b170..9ebcd3241da 100644 --- a/src/legacy/FakeLib/FSIHelper.fs +++ b/src/legacy/FakeLib/FSIHelper.fs @@ -12,7 +12,7 @@ open System.Text.RegularExpressions open System.Xml.Linq open Yaaf.FSharp.Scripting -let private FSIPath = @".\tools\FSharp\;.\lib\FSharp\;[ProgramFilesX86]\Microsoft SDKs\F#\10.1\Framework\v4.0;[ProgramFilesX86]\Microsoft SDKs\F#\4.1\Framework\v4.0;[ProgramFilesX86]\Microsoft SDKs\F#\4.0\Framework\v4.0;[ProgramFilesX86]\Microsoft SDKs\F#\3.1\Framework\v4.0;[ProgramFilesX86]\Microsoft SDKs\F#\3.0\Framework\v4.0;[ProgramFiles]\Microsoft F#\v4.0\;[ProgramFilesX86]\Microsoft F#\v4.0\;[ProgramFiles]\FSharp-2.0.0.0\bin\;[ProgramFilesX86]\FSharp-2.0.0.0\bin\;[ProgramFiles]\FSharp-1.9.9.9\bin\;[ProgramFilesX86]\FSharp-1.9.9.9\bin\" +let private FSIPath = @".\tools\FSharp\;.\lib\FSharp\;[ProgramFilesX86]\Microsoft SDKs\F#\10.1\Framework\v4.0;[ProgramFilesX86]\Microsoft SDKs\F#\4.1\Framework\v4.0;[ProgramFilesX86]\Microsoft SDKs\F#\4.0\Framework\v4.0;[ProgramFilesX86]\Microsoft SDKs\F#\3.1\Framework\v4.0;[ProgramFilesX86]\Microsoft SDKs\F#\3.0\Framework\v4.0;[ProgramFiles]\Microsoft F#\v4.0\;[ProgramFilesX86]\Microsoft F#\v4.0\;[ProgramFiles]\FSharp-2.0.0.0\bin\;[ProgramFilesX86]\FSharp-2.0.0.0\bin\;[ProgramFiles]\FSharp-1.9.9.9\bin\;[ProgramFilesX86]\FSharp-1.9.9.9\bin\;C:\Program Files (x86)\Microsoft Visual Studio\2017\enterprise\Common7\IDE\CommonExtensions\Microsoft\FSharp\;C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\Common7\IDE\CommonExtensions\Microsoft\FSharp\;C:\Program Files (x86)\Microsoft Visual Studio\2017\community\Common7\IDE\CommonExtensions\Microsoft\FSharp\;C:\Program Files (x86)\Microsoft Visual Studio\2019\enterprise\Common7\IDE\CommonExtensions\Microsoft\FSharp\;C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\Common7\IDE\CommonExtensions\Microsoft\FSharp\;C:\Program Files (x86)\Microsoft Visual Studio\2019\community\Common7\IDE\CommonExtensions\Microsoft\FSharp\" [] let createDirectiveRegex id = From 32dd3dd7fe89585329a2f305995cae8d7d5b2911 Mon Sep 17 00:00:00 2001 From: YazeedObaid Date: Tue, 21 Jul 2020 15:35:48 +0300 Subject: [PATCH 4/6] fix case of paths! --- src/legacy/FakeLib/FSIHelper.fs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/legacy/FakeLib/FSIHelper.fs b/src/legacy/FakeLib/FSIHelper.fs index 9ebcd3241da..11448af9f0e 100644 --- a/src/legacy/FakeLib/FSIHelper.fs +++ b/src/legacy/FakeLib/FSIHelper.fs @@ -12,7 +12,7 @@ open System.Text.RegularExpressions open System.Xml.Linq open Yaaf.FSharp.Scripting -let private FSIPath = @".\tools\FSharp\;.\lib\FSharp\;[ProgramFilesX86]\Microsoft SDKs\F#\10.1\Framework\v4.0;[ProgramFilesX86]\Microsoft SDKs\F#\4.1\Framework\v4.0;[ProgramFilesX86]\Microsoft SDKs\F#\4.0\Framework\v4.0;[ProgramFilesX86]\Microsoft SDKs\F#\3.1\Framework\v4.0;[ProgramFilesX86]\Microsoft SDKs\F#\3.0\Framework\v4.0;[ProgramFiles]\Microsoft F#\v4.0\;[ProgramFilesX86]\Microsoft F#\v4.0\;[ProgramFiles]\FSharp-2.0.0.0\bin\;[ProgramFilesX86]\FSharp-2.0.0.0\bin\;[ProgramFiles]\FSharp-1.9.9.9\bin\;[ProgramFilesX86]\FSharp-1.9.9.9\bin\;C:\Program Files (x86)\Microsoft Visual Studio\2017\enterprise\Common7\IDE\CommonExtensions\Microsoft\FSharp\;C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\Common7\IDE\CommonExtensions\Microsoft\FSharp\;C:\Program Files (x86)\Microsoft Visual Studio\2017\community\Common7\IDE\CommonExtensions\Microsoft\FSharp\;C:\Program Files (x86)\Microsoft Visual Studio\2019\enterprise\Common7\IDE\CommonExtensions\Microsoft\FSharp\;C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\Common7\IDE\CommonExtensions\Microsoft\FSharp\;C:\Program Files (x86)\Microsoft Visual Studio\2019\community\Common7\IDE\CommonExtensions\Microsoft\FSharp\" +let private FSIPath = @".\tools\FSharp\;.\lib\FSharp\;[ProgramFilesX86]\Microsoft SDKs\F#\10.1\Framework\v4.0;[ProgramFilesX86]\Microsoft SDKs\F#\4.1\Framework\v4.0;[ProgramFilesX86]\Microsoft SDKs\F#\4.0\Framework\v4.0;[ProgramFilesX86]\Microsoft SDKs\F#\3.1\Framework\v4.0;[ProgramFilesX86]\Microsoft SDKs\F#\3.0\Framework\v4.0;[ProgramFiles]\Microsoft F#\v4.0\;[ProgramFilesX86]\Microsoft F#\v4.0\;[ProgramFiles]\FSharp-2.0.0.0\bin\;[ProgramFilesX86]\FSharp-2.0.0.0\bin\;[ProgramFiles]\FSharp-1.9.9.9\bin\;[ProgramFilesX86]\FSharp-1.9.9.9\bin\;C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\Common7\IDE\CommonExtensions\Microsoft\FSharp\;C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\Common7\IDE\CommonExtensions\Microsoft\FSharp\;C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\Common7\IDE\CommonExtensions\Microsoft\FSharp\;C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\Common7\IDE\CommonExtensions\Microsoft\FSharp\;C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\Common7\IDE\CommonExtensions\Microsoft\FSharp\;C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\Common7\IDE\CommonExtensions\Microsoft\FSharp\" [] let createDirectiveRegex id = From eae33322fd44d664e0edcef900697bf7dae9188b Mon Sep 17 00:00:00 2001 From: MohammdJawabreh Date: Tue, 4 May 2021 15:08:41 +0300 Subject: [PATCH 5/6] WIP Add Azure Cli --- Fake.sln | 17 +- src/app/Fake.Azure.Cli/Cli.fs | 374 +++++++++++++++++++ src/app/Fake.Azure.Cli/Fake.Azure.Cli.fsproj | 17 + 3 files changed, 407 insertions(+), 1 deletion(-) create mode 100644 src/app/Fake.Azure.Cli/Cli.fs create mode 100644 src/app/Fake.Azure.Cli/Fake.Azure.Cli.fsproj diff --git a/Fake.sln b/Fake.sln index 9417579ac44..b8f04cce83f 100644 --- a/Fake.sln +++ b/Fake.sln @@ -187,7 +187,9 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "TestTools", "TestTools", "{ EndProject Project("{6EC3EE1D-3C4E-46DD-8F32-0CC8E7565705}") = "Fake.Core.DependencyManager.Paket", "src\app\Fake.Core.DependencyManager.Paket\Fake.Core.DependencyManager.Paket.fsproj", "{F4D3249D-F4EC-4B86-BEA8-3F2314ED9B65}" EndProject -Project("{F2A71F9B-5D33-465A-A702-920D77279786}") = "Fake.BuildServer.GitHubActions", "src\app\Fake.BuildServer.GitHubActions\Fake.BuildServer.GitHubActions.fsproj", "{AB09E8EB-A66E-4D60-B47C-4F35F439D020}" +Project("{6EC3EE1D-3C4E-46DD-8F32-0CC8E7565705}") = "Fake.BuildServer.GitHubActions", "src\app\Fake.BuildServer.GitHubActions\Fake.BuildServer.GitHubActions.fsproj", "{AB09E8EB-A66E-4D60-B47C-4F35F439D020}" +EndProject +Project("{6EC3EE1D-3C4E-46DD-8F32-0CC8E7565705}") = "Fake.Azure.Cli", "src\app\Fake.Azure.Cli\Fake.Azure.Cli.fsproj", "{BA1B958D-1D80-45F8-BADE-E8D78AFF8DD1}" EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution @@ -1182,6 +1184,18 @@ Global {AB09E8EB-A66E-4D60-B47C-4F35F439D020}.Release|x64.Build.0 = Release|Any CPU {AB09E8EB-A66E-4D60-B47C-4F35F439D020}.Release|x86.ActiveCfg = Release|Any CPU {AB09E8EB-A66E-4D60-B47C-4F35F439D020}.Release|x86.Build.0 = Release|Any CPU + {BA1B958D-1D80-45F8-BADE-E8D78AFF8DD1}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {BA1B958D-1D80-45F8-BADE-E8D78AFF8DD1}.Debug|Any CPU.Build.0 = Debug|Any CPU + {BA1B958D-1D80-45F8-BADE-E8D78AFF8DD1}.Debug|x64.ActiveCfg = Debug|Any CPU + {BA1B958D-1D80-45F8-BADE-E8D78AFF8DD1}.Debug|x64.Build.0 = Debug|Any CPU + {BA1B958D-1D80-45F8-BADE-E8D78AFF8DD1}.Debug|x86.ActiveCfg = Debug|Any CPU + {BA1B958D-1D80-45F8-BADE-E8D78AFF8DD1}.Debug|x86.Build.0 = Debug|Any CPU + {BA1B958D-1D80-45F8-BADE-E8D78AFF8DD1}.Release|Any CPU.ActiveCfg = Release|Any CPU + {BA1B958D-1D80-45F8-BADE-E8D78AFF8DD1}.Release|Any CPU.Build.0 = Release|Any CPU + {BA1B958D-1D80-45F8-BADE-E8D78AFF8DD1}.Release|x64.ActiveCfg = Release|Any CPU + {BA1B958D-1D80-45F8-BADE-E8D78AFF8DD1}.Release|x64.Build.0 = Release|Any CPU + {BA1B958D-1D80-45F8-BADE-E8D78AFF8DD1}.Release|x86.ActiveCfg = Release|Any CPU + {BA1B958D-1D80-45F8-BADE-E8D78AFF8DD1}.Release|x86.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE @@ -1270,6 +1284,7 @@ Global {9200793A-8B59-4242-A5C8-F37CE08DE801} = {CCAC5CAB-03C8-4C11-ADBE-A0D05F6A4F18} {F4D3249D-F4EC-4B86-BEA8-3F2314ED9B65} = {7BFFAE76-DEE9-417A-A79B-6A6644C4553A} {AB09E8EB-A66E-4D60-B47C-4F35F439D020} = {7BFFAE76-DEE9-417A-A79B-6A6644C4553A} + {BA1B958D-1D80-45F8-BADE-E8D78AFF8DD1} = {7BFFAE76-DEE9-417A-A79B-6A6644C4553A} EndGlobalSection GlobalSection(ExtensibilityGlobals) = postSolution SolutionGuid = {058A0C5E-2216-4306-8AFB-0AE28320C26A} diff --git a/src/app/Fake.Azure.Cli/Cli.fs b/src/app/Fake.Azure.Cli/Cli.fs new file mode 100644 index 00000000000..1b320131100 --- /dev/null +++ b/src/app/Fake.Azure.Cli/Cli.fs @@ -0,0 +1,374 @@ +module Fake.Azure.Cli + +open System +open Fake.Core + + type AzCommands = + | Account of string + | Acr of string + | Acs of string + | Ad of string + | Advisor of string + | Afd of string + | AiExamples of string + | Aks of string + | Alias of string + | Ams of string + | Apim of string + | Appconfig of string + | Appservice of string + | Arcappliance of string + | Aro of string + | Artifacts of string + | Attestation of string + | Automation of string + | Backup of string + | Baremetalinstance of string + | Batch of string + | Batchai of string + | Bicep of string + | Billing of string + | Blockchain of string + | Blueprint of string + | Boards of string + | Bot of string + | Cache of string + | Cdn of string + | CliTranslator of string + | Cloud of string + | CloudService of string + | Codespace of string + | Cognitiveservices of string + | Communication of string + | Config of string + | Configure of string + | Confluent of string + | Connectedk8s of string + | Connectedmachine of string + | Consumption of string + | Container of string + | Cosmosdb of string + | Costmanagement of string + | Csvmware of string + | Customlocation of string + | CustomProviders of string + | Databox of string + | Databoxedge of string + | Databricks of string + | Datafactory of string + | Datashare of string + | DedicatedHsm of string + | Demo of string + | Deployment of string + | Deploymentmanager of string + | DeploymentScripts of string + | Desktopvirtualization of string + | Devops of string + | Disk of string + | DiskAccess of string + | DiskEncryptionSet of string + | Dla of string + | Dls of string + | Dms of string + | Dt of string + | Eventgrid of string + | Eventhubs of string + | Extension of string + | Feature of string + | Feedback of string + | Find of string + | Footprint of string + | Functionapp of string + | Fzf of string + | Graph of string + | Group of string + | Guestconfig of string + | Hack of string + | Hanainstance of string + | Hdinsight of string + | Healthbot of string + | Healthcareapis of string + | HpcCache of string + | Identity of string + | Image of string + | ImportExport of string + | Interactive of string + | InternetAnalyzer of string + | Iot of string + | K8sconfiguration of string + | K8sConfiguration of string + | K8sExtension of string + | Keyvault of string + | Kusto of string + | Lab of string + | LocalContext of string + | Lock of string + | Logic of string + | Login of string + | Logout of string + | Maintenance of string + | Managedapp of string + | ManagedCassandra of string + | Managedservices of string + | Managementpartner of string + | Maps of string + | Mariadb of string + | Mesh of string + | Ml of string + | Monitor of string + | Mysql of string + | Netappfiles of string + | Network of string + | Next of string + | NotificationHub of string + | Offazure of string + | Openshift of string + | Peering of string + | Pipelines of string + | Policy of string + | Portal of string + | Postgres of string + | Powerbi of string + | Ppg of string + | Provider of string + | Providerhub of string + | Quantum of string + | Redis of string + | Redisenterprise of string + | Relay of string + | RemoteRenderingAccount of string + | Repos of string + | Reservations of string + | Resource of string + | ResourceMover of string + | Rest of string + | Role of string + | Sapmonitor of string + | Search of string + | Security of string + | SelfTest of string + | Sentinel of string + | Servicebus of string + | Sf of string + | Sig of string + | Signalr of string + | Snapshot of string + | SpatialAnchorsAccount of string + | SpringCloud of string + | Sql of string + | Ssh of string + | Sshkey of string + | StackHci of string + | Staticwebapp of string + | Storage of string + | Storagesync of string + | StreamAnalytics of string + | Support of string + | Synapse of string + | Tag of string + | Ts of string + | Tsi of string + | Upgrade of string + | Version of string + | Vm of string + | Vmss of string + | Vmware of string + | Webapp of string + + let parse = function + | Account str -> sprintf "account %s" str + | Acr str -> sprintf "Acr %s" str + | Acs str -> sprintf "Acs %s" str + | Ad str -> sprintf "Ad %s" str + | Advisor str -> sprintf "Advisor %s" str + | Afd str -> sprintf "Afd %s" str + | AiExamples str -> sprintf "AiExamples %s" str + | Aks str -> sprintf "Aks %s" str + | Alias str -> sprintf "Alias %s" str + | Ams str -> sprintf "Ams %s" str + | Apim str -> sprintf "Apim %s" str + | Appconfig str -> sprintf "Appconfig %s" str + | Appservice str -> sprintf "Appservice %s" str + | Arcappliance str -> sprintf "Arcappliance %s" str + | Aro str -> sprintf "Aro %s" str + | Artifacts str -> sprintf "Artifacts %s" str + | Attestation str -> sprintf "Attestation %s" str + | Automation str -> sprintf "Automation %s" str + | Backup str -> sprintf "Backup %s" str + | Baremetalinstance str -> sprintf "Baremetalinstance %s" str + | Batch str -> sprintf "Batch %s" str + | Batchai str -> sprintf "Batchai %s" str + | Bicep str -> sprintf "Bicep %s" str + | Billing str -> sprintf "Billing %s" str + | Blockchain str -> sprintf "Blockchain %s" str + | Blueprint str -> sprintf "Blueprint %s" str + | Boards str -> sprintf "Boards %s" str + | Bot str -> sprintf "Bot %s" str + | Cache str -> sprintf "Cache %s" str + | Cdn str -> sprintf "Cdn %s" str + | CliTranslator str -> sprintf "CliTranslator %s" str + | Cloud str -> sprintf "Cloud %s" str + | CloudService str -> sprintf "CloudService %s" str + | Codespace str -> sprintf "Codespace %s" str + | Cognitiveservices str -> sprintf "Cognitiveservices %s" str + | Communication str -> sprintf "Communication %s" str + | Config str -> sprintf "Config %s" str + | Configure str -> sprintf "Configure %s" str + | Confluent str -> sprintf "Confluent %s" str + | Connectedk8s str -> sprintf "Connectedk8s %s" str + | Connectedmachine str -> sprintf "Connectedmachine %s" str + | Consumption str -> sprintf "Consumption %s" str + | Container str -> sprintf "Container %s" str + | Cosmosdb str -> sprintf "Cosmosdb %s" str + | Costmanagement str -> sprintf "Costmanagement %s" str + | Csvmware str -> sprintf "Csvmware %s" str + | Customlocation str -> sprintf "Customlocation %s" str + | CustomProviders str -> sprintf "CustomProviders %s" str + | Databox str -> sprintf "Databox %s" str + | Databoxedge str -> sprintf "Databoxedge %s" str + | Databricks str -> sprintf "Databricks %s" str + | Datafactory str -> sprintf "Datafactory %s" str + | Datashare str -> sprintf "Datashare %s" str + | DedicatedHsm str -> sprintf "DedicatedHsm %s" str + | Demo str -> sprintf "Demo %s" str + | Deployment str -> sprintf "Deployment %s" str + | Deploymentmanager str -> sprintf "Deploymentmanager %s" str + | DeploymentScripts str -> sprintf "DeploymentScripts %s" str + | Desktopvirtualization str -> sprintf "Desktopvirtualization %s" str + | Devops str -> sprintf "Devops %s" str + | Disk str -> sprintf "Disk %s" str + | DiskAccess str -> sprintf "DiskAccess %s" str + | DiskEncryptionSet str -> sprintf "DiskEncryptionSet %s" str + | Dla str -> sprintf "Dla %s" str + | Dls str -> sprintf "Dls %s" str + | Dms str -> sprintf "Dms %s" str + | Dt str -> sprintf "Dt %s" str + | Eventgrid str -> sprintf "Eventgrid %s" str + | Eventhubs str -> sprintf "Eventhubs %s" str + | Extension str -> sprintf "Extension %s" str + | Feature str -> sprintf "Feature %s" str + | Feedback str -> sprintf "Feedback %s" str + | Find str -> sprintf "Find %s" str + | Footprint str -> sprintf "Footprint %s" str + | Functionapp str -> sprintf "Functionapp %s" str + | Fzf str -> sprintf "Fzf %s" str + | Graph str -> sprintf "Graph %s" str + | Group str -> sprintf "Group %s" str + | Guestconfig str -> sprintf "Guestconfig %s" str + | Hack str -> sprintf "Hack %s" str + | Hanainstance str -> sprintf "Hanainstance %s" str + | Hdinsight str -> sprintf "Hdinsight %s" str + | Healthbot str -> sprintf "Healthbot %s" str + | Healthcareapis str -> sprintf "Healthcareapis %s" str + | HpcCache str -> sprintf "HpcCache %s" str + | Identity str -> sprintf "Identity %s" str + | Image str -> sprintf "Image %s" str + | ImportExport str -> sprintf "ImportExport %s" str + | Interactive str -> sprintf "Interactive %s" str + | InternetAnalyzer str -> sprintf "InternetAnalyzer %s" str + | Iot str -> sprintf "Iot %s" str + | K8sconfiguration str -> sprintf "K8sconfiguration %s" str + | K8sConfiguration str -> sprintf "K8sConfiguration %s" str + | K8sExtension str -> sprintf "K8sExtension %s" str + | Keyvault str -> sprintf "Keyvault %s" str + | Kusto str -> sprintf "Kusto %s" str + | Lab str -> sprintf "Lab %s" str + | LocalContext str -> sprintf "LocalContext %s" str + | Lock str -> sprintf "Lock %s" str + | Logic str -> sprintf "Logic %s" str + | Login str -> sprintf "Login %s" str + | Logout str -> sprintf "Logout %s" str + | Maintenance str -> sprintf "Maintenance %s" str + | Managedapp str -> sprintf "Managedapp %s" str + | ManagedCassandra str -> sprintf "ManagedCassandra %s" str + | Managedservices str -> sprintf "Managedservices %s" str + | Managementpartner str -> sprintf "Managementpartner %s" str + | Maps str -> sprintf "Maps %s" str + | Mariadb str -> sprintf "Mariadb %s" str + | Mesh str -> sprintf "Mesh %s" str + | Ml str -> sprintf "Ml %s" str + | Monitor str -> sprintf "Monitor %s" str + | Mysql str -> sprintf "Mysql %s" str + | Netappfiles str -> sprintf "Netappfiles %s" str + | Network str -> sprintf "Network %s" str + | Next str -> sprintf "Next %s" str + | NotificationHub str -> sprintf "NotificationHub %s" str + | Offazure str -> sprintf "Offazure %s" str + | Openshift str -> sprintf "Openshift %s" str + | Peering str -> sprintf "Peering %s" str + | Pipelines str -> sprintf "Pipelines %s" str + | Policy str -> sprintf "Policy %s" str + | Portal str -> sprintf "Portal %s" str + | Postgres str -> sprintf "Postgres %s" str + | Powerbi str -> sprintf "Powerbi %s" str + | Ppg str -> sprintf "Ppg %s" str + | Provider str -> sprintf "Provider %s" str + | Providerhub str -> sprintf "Providerhub %s" str + | Quantum str -> sprintf "Quantum %s" str + | Redis str -> sprintf "Redis %s" str + | Redisenterprise str -> sprintf "Redisenterprise %s" str + | Relay str -> sprintf "Relay %s" str + | RemoteRenderingAccount str -> sprintf "RemoteRenderingAccount %s" str + | Repos str -> sprintf "Repos %s" str + | Reservations str -> sprintf "Reservations %s" str + | Resource str -> sprintf "Resource %s" str + | ResourceMover str -> sprintf "ResourceMover %s" str + | Rest str -> sprintf "Rest %s" str + | Role str -> sprintf "Role %s" str + | Sapmonitor str -> sprintf "Sapmonitor %s" str + | Search str -> sprintf "Search %s" str + | Security str -> sprintf "Security %s" str + | SelfTest str -> sprintf "SelfTest %s" str + | Sentinel str -> sprintf "Sentinel %s" str + | Servicebus str -> sprintf "Servicebus %s" str + | Sf str -> sprintf "Sf %s" str + | Sig str -> sprintf "Sig %s" str + | Signalr str -> sprintf "Signalr %s" str + | Snapshot str -> sprintf "Snapshot %s" str + | SpatialAnchorsAccount str -> sprintf "SpatialAnchorsAccount %s" str + | SpringCloud str -> sprintf "SpringCloud %s" str + | Sql str -> sprintf "Sql %s" str + | Ssh str -> sprintf "Ssh %s" str + | Sshkey str -> sprintf "Sshkey %s" str + | StackHci str -> sprintf "StackHci %s" str + | Staticwebapp str -> sprintf "Staticwebapp %s" str + | Storage str -> sprintf "Storage %s" str + | Storagesync str -> sprintf "Storagesync %s" str + | StreamAnalytics str -> sprintf "StreamAnalytics %s" str + | Support str -> sprintf "Support %s" str + | Synapse str -> sprintf "Synapse %s" str + | Tag str -> sprintf "Tag %s" str + | Ts str -> sprintf "Ts %s" str + | Tsi str -> sprintf "Tsi %s" str + | Upgrade str -> sprintf "Upgrade %s" str + | Version str -> sprintf "Version %s" str + | Vm str -> sprintf "Vm %s" str + | Vmss str -> sprintf "Vmss %s" str + | Vmware str -> sprintf "Vmware %s" str + | Webapp str -> sprintf "Webapp %s" str + +module AzCli = + + let runPowerOrShRaw commands = + let shell, args = + if Environment.isWindows then + "powershell", sprintf " az %s " commands + else + "az", commands + printfn "%s" args + args + |> Args.fromWindowsCommandLine + |> Seq.toList + |> CreateProcess.fromRawCommand shell + |> CreateProcess.redirectOutput + |> CreateProcess.withTimeout TimeSpan.MaxValue + |> Proc.run + + /// Runs the given process and returns the process result. + let run command = + let args = command |> parse + + let result = runPowerOrShRaw args + + result.ExitCode + diff --git a/src/app/Fake.Azure.Cli/Fake.Azure.Cli.fsproj b/src/app/Fake.Azure.Cli/Fake.Azure.Cli.fsproj new file mode 100644 index 00000000000..69b5958b323 --- /dev/null +++ b/src/app/Fake.Azure.Cli/Fake.Azure.Cli.fsproj @@ -0,0 +1,17 @@ + + + + Exe + netstandard2.0;net472 + + + + + + + + + + + + From df9c8fc96c594bd2d0a0fb34e9e8638e67dd2ccf Mon Sep 17 00:00:00 2001 From: MohammdJawabreh Date: Mon, 17 May 2021 15:23:52 +0300 Subject: [PATCH 6/6] return the output --- src/app/Fake.Azure.Cli/Cli.fs | 18 ++++++++++-------- src/app/Fake.Azure.Cli/Fake.Azure.Cli.fsproj | 2 +- 2 files changed, 11 insertions(+), 9 deletions(-) diff --git a/src/app/Fake.Azure.Cli/Cli.fs b/src/app/Fake.Azure.Cli/Cli.fs index 1b320131100..a71e3da1ced 100644 --- a/src/app/Fake.Azure.Cli/Cli.fs +++ b/src/app/Fake.Azure.Cli/Cli.fs @@ -1,8 +1,8 @@ -module Fake.Azure.Cli + +module Fake.Azure.Cli open System open Fake.Core - type AzCommands = | Account of string | Acr of string @@ -175,7 +175,7 @@ open Fake.Core | Vmware of string | Webapp of string - let parse = function + let private parse = function | Account str -> sprintf "account %s" str | Acr str -> sprintf "Acr %s" str | Acs str -> sprintf "Acs %s" str @@ -276,7 +276,7 @@ open Fake.Core | LocalContext str -> sprintf "LocalContext %s" str | Lock str -> sprintf "Lock %s" str | Logic str -> sprintf "Logic %s" str - | Login str -> sprintf "Login %s" str + | Login str -> sprintf "Login %s" str | Logout str -> sprintf "Logout %s" str | Maintenance str -> sprintf "Maintenance %s" str | Managedapp str -> sprintf "Managedapp %s" str @@ -355,7 +355,6 @@ module AzCli = "powershell", sprintf " az %s " commands else "az", commands - printfn "%s" args args |> Args.fromWindowsCommandLine |> Seq.toList @@ -364,11 +363,14 @@ module AzCli = |> CreateProcess.withTimeout TimeSpan.MaxValue |> Proc.run + /// Runs the given process and returns the process result. let run command = let args = command |> parse - - let result = runPowerOrShRaw args + let result = runPowerOrShRaw args - result.ExitCode + match result.Result.Output with + | a when a = "[]" -> sprintf "\n Exit Code %d \n %s" result.ExitCode result.Result.Output + | _ -> sprintf "\n Exit Code %d \n %s" result.ExitCode result.Result.Error + diff --git a/src/app/Fake.Azure.Cli/Fake.Azure.Cli.fsproj b/src/app/Fake.Azure.Cli/Fake.Azure.Cli.fsproj index 69b5958b323..5e0ca6a9b9c 100644 --- a/src/app/Fake.Azure.Cli/Fake.Azure.Cli.fsproj +++ b/src/app/Fake.Azure.Cli/Fake.Azure.Cli.fsproj @@ -1,7 +1,7 @@  - Exe + Library netstandard2.0;net472