Skip to content

Commit

Permalink
Try moving back to PS 7.2
Browse files Browse the repository at this point in the history
  • Loading branch information
svrooij committed May 5, 2024
1 parent c1bc11e commit 33c7f42
Show file tree
Hide file tree
Showing 23 changed files with 955 additions and 383 deletions.
8 changes: 6 additions & 2 deletions src/Svrooij.WinTuner.CmdLets/Commands/DeployWtMsStoreApp.cs
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,9 @@ public override async Task ProcessRecordAsync(CancellationToken cancellationToke
ValidateAuthenticationParameters();
if (ParameterSetName == nameof(SearchQuery))
{
#if NET8_0_OR_GREATER
ArgumentException.ThrowIfNullOrWhiteSpace(SearchQuery);
#endif
logger!.LogInformation("Searching package id for {searchQuery}", SearchQuery);
PackageId = await graphStoreAppUploader!.GetStoreIdForNameAsync(SearchQuery!, cancellationToken);
if (string.IsNullOrEmpty(PackageId))
Expand All @@ -72,13 +74,15 @@ public override async Task ProcessRecordAsync(CancellationToken cancellationToke
}

// At this moment the package ID should always be filled.
ArgumentException.ThrowIfNullOrWhiteSpace(PackageId);

#if NET8_0_OR_GREATER
ArgumentException.ThrowIfNullOrWhiteSpace(PackageId);
#endif
logger!.LogInformation("Uploading MSStore app {PackageId} to Intune", PackageId);
var graphServiceClient = CreateGraphServiceClient(httpClient!);
try
{
var app = await graphStoreAppUploader!.CreateStoreAppAsync(graphServiceClient, PackageId, cancellationToken);
var app = await graphStoreAppUploader!.CreateStoreAppAsync(graphServiceClient, PackageId!, cancellationToken);

logger!.LogInformation("Created MSStore app {PackageId} with id {appId}", PackageId, app!.Id);
WriteObject(app);
Expand Down
6 changes: 3 additions & 3 deletions src/Svrooij.WinTuner.CmdLets/Svrooij.WinTuner.CmdLets.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<TargetFramework>net6.0</TargetFramework>
<AssemblyName>Svrooij.WinTuner.CmdLets</AssemblyName>
<LangVersion>10.0</LangVersion>
<SatelliteResourceLanguages>en</SatelliteResourceLanguages>
Expand All @@ -14,8 +14,8 @@

<ItemGroup>
<PackageReference Include="Azure.Identity" Version="1.11.2" />
<PackageReference Include="Svrooij.PowerShell.DependencyInjection" Version="1.1.0" />
<PackageReference Include="PowerShellStandard.Library" Version="5.1.1">
<PackageReference Include="Svrooij.PowerShell.DependencyInjection" Version="1.1.4" />
<PackageReference Include="Microsoft.PowerShell.SDK" Version="7.2.19">
<PrivateAssets>All</PrivateAssets>
</PackageReference>
</ItemGroup>
Expand Down
3 changes: 2 additions & 1 deletion src/Svrooij.WinTuner.CmdLets/WinTuner.psd1
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,8 @@

# Minimum version of the Windows PowerShell engine required by this module.
# This module is build on net8.0 which requires PowerShell 7.4
PowerShellVersion = '7.4'
# May 5th 2024 Bring back support for PowerShell 7.2 (which seems to be the only supported version in Azure Runbooks)
PowerShellVersion = '7.2'

# Minimum version of the .NET Framework required by this module.
# DotNetFrameworkVersion = '4.7.2'
Expand Down
Loading

0 comments on commit 33c7f42

Please sign in to comment.