From e4412a9523da4a11b875943094353544072c987a Mon Sep 17 00:00:00 2001 From: Dmitry Nefedov Date: Mon, 6 Jan 2025 19:45:01 +0300 Subject: [PATCH] Fixed missing parameter --- src/Sophia_Script_for_Windows_10/Module/Sophia.psm1 | 6 +++--- src/Sophia_Script_for_Windows_10/Sophia.ps1 | 11 ++++++++--- .../Module/Sophia.psm1 | 8 ++++---- .../Sophia.ps1 | 13 +++++++++---- .../Module/Sophia.psm1 | 8 ++++---- .../Sophia.ps1 | 13 +++++++++---- .../Module/Sophia.psm1 | 6 +++--- .../Sophia.ps1 | 11 ++++++++--- src/Sophia_Script_for_Windows_11/Module/Sophia.psm1 | 6 +++--- src/Sophia_Script_for_Windows_11/Sophia.ps1 | 11 ++++++++--- .../Module/Sophia.psm1 | 6 +++--- .../Sophia.ps1 | 11 ++++++++--- .../Module/Sophia.psm1 | 6 +++--- .../Sophia.ps1 | 11 ++++++++--- 14 files changed, 81 insertions(+), 46 deletions(-) diff --git a/src/Sophia_Script_for_Windows_10/Module/Sophia.psm1 b/src/Sophia_Script_for_Windows_10/Module/Sophia.psm1 index 37b3bf2e..bf7b5ddf 100644 --- a/src/Sophia_Script_for_Windows_10/Module/Sophia.psm1 +++ b/src/Sophia_Script_for_Windows_10/Module/Sophia.psm1 @@ -12235,7 +12235,7 @@ function CleanupTask } # Convert SID to username - $TaskUserAccount = (New-Object System.Security.Principal.SecurityIdentifier($SID)).Translate([System.Security.Principal.NTAccount]).Value -split "\\" | Select-Object -Last 1 + $TaskUserAccount = (New-Object -TypeName System.Security.Principal.SecurityIdentifier($SID)).Translate([System.Security.Principal.NTAccount]).Value -split "\\" | Select-Object -Last 1 if ($TaskUserAccount -ne $env:USERNAME) { @@ -12675,7 +12675,7 @@ function SoftwareDistributionTask } # Convert SID to username - $TaskUserAccount = (New-Object System.Security.Principal.SecurityIdentifier($SID)).Translate([System.Security.Principal.NTAccount]).Value -split "\\" | Select-Object -Last 1 + $TaskUserAccount = (New-Object -TypeName System.Security.Principal.SecurityIdentifier($SID)).Translate([System.Security.Principal.NTAccount]).Value -split "\\" | Select-Object -Last 1 if ($TaskUserAccount -ne $env:USERNAME) { @@ -12993,7 +12993,7 @@ function TempTask } # Convert SID to username - $TaskUserAccount = (New-Object System.Security.Principal.SecurityIdentifier($SID)).Translate([System.Security.Principal.NTAccount]).Value -split "\\" | Select-Object -Last 1 + $TaskUserAccount = (New-Object -TypeName System.Security.Principal.SecurityIdentifier($SID)).Translate([System.Security.Principal.NTAccount]).Value -split "\\" | Select-Object -Last 1 if ($TaskUserAccount -ne $env:USERNAME) { diff --git a/src/Sophia_Script_for_Windows_10/Sophia.ps1 b/src/Sophia_Script_for_Windows_10/Sophia.ps1 index 1ca79695..f6e08ac2 100644 --- a/src/Sophia_Script_for_Windows_10/Sophia.ps1 +++ b/src/Sophia_Script_for_Windows_10/Sophia.ps1 @@ -2,11 +2,16 @@ .SYNOPSIS Default preset file for "Sophia Script for Windows 10" - Version: 5.20.0 - Date: 29.12.2024 + .VERSION + 5.20.0 - Copyright (c) 2014—2025 farag, Inestic & lowl1f3 + .DATE + 29.12.2024 + .COPYRIGHT + (c) 2014—2025 farag, Inestic & lowl1f3 + + .THANKS Thanks to all https://forum.ru-board.com members involved .DESCRIPTION diff --git a/src/Sophia_Script_for_Windows_10_LTSC_2019/Module/Sophia.psm1 b/src/Sophia_Script_for_Windows_10_LTSC_2019/Module/Sophia.psm1 index 170f6155..4b8bed11 100644 --- a/src/Sophia_Script_for_Windows_10_LTSC_2019/Module/Sophia.psm1 +++ b/src/Sophia_Script_for_Windows_10_LTSC_2019/Module/Sophia.psm1 @@ -18,7 +18,7 @@ Thanks to all https://forum.ru-board.com members involved .NOTES - Supported Windows 10 x64 Enterprise LTSC 2019 + Supports Windows 10 x64 Enterprise LTSC 2019 .LINK https://github.com/farag2/Sophia-Script-for-Windows @@ -9007,7 +9007,7 @@ function CleanupTask } # Convert SID to username - $TaskUserAccount = (New-Object System.Security.Principal.SecurityIdentifier($SID)).Translate([System.Security.Principal.NTAccount]).Value -split "\\" | Select-Object -Last 1 + $TaskUserAccount = (New-Object -TypeName System.Security.Principal.SecurityIdentifier($SID)).Translate([System.Security.Principal.NTAccount]).Value -split "\\" | Select-Object -Last 1 if ($TaskUserAccount -ne $env:USERNAME) { @@ -9447,7 +9447,7 @@ function SoftwareDistributionTask } # Convert SID to username - $TaskUserAccount = (New-Object System.Security.Principal.SecurityIdentifier($SID)).Translate([System.Security.Principal.NTAccount]).Value -split "\\" | Select-Object -Last 1 + $TaskUserAccount = (New-Object -TypeName System.Security.Principal.SecurityIdentifier($SID)).Translate([System.Security.Principal.NTAccount]).Value -split "\\" | Select-Object -Last 1 if ($TaskUserAccount -ne $env:USERNAME) { @@ -9765,7 +9765,7 @@ function TempTask } # Convert SID to username - $TaskUserAccount = (New-Object System.Security.Principal.SecurityIdentifier($SID)).Translate([System.Security.Principal.NTAccount]).Value -split "\\" | Select-Object -Last 1 + $TaskUserAccount = (New-Object -TypeName System.Security.Principal.SecurityIdentifier($SID)).Translate([System.Security.Principal.NTAccount]).Value -split "\\" | Select-Object -Last 1 if ($TaskUserAccount -ne $env:USERNAME) { diff --git a/src/Sophia_Script_for_Windows_10_LTSC_2019/Sophia.ps1 b/src/Sophia_Script_for_Windows_10_LTSC_2019/Sophia.ps1 index d9825d87..d86001b1 100644 --- a/src/Sophia_Script_for_Windows_10_LTSC_2019/Sophia.ps1 +++ b/src/Sophia_Script_for_Windows_10_LTSC_2019/Sophia.ps1 @@ -2,11 +2,16 @@ .SYNOPSIS Default preset file for "Sophia Script for Windows 10 LTSC 2019" - Version: 5.10.0 - Date: 29.12.2024 + .VERSION + 5.10.0 - Copyright (c) 2014—2025 farag, Inestic & lowl1f3 + .DATE + 29.12.2024 + .COPYRIGHT + (c) 2014—2025 farag, Inestic & lowl1f3 + + .THANKS Thanks to all https://forum.ru-board.com members involved .DESCRIPTION @@ -24,7 +29,7 @@ iwr script.sophia.team -useb | iex .NOTES - Supported Windows 10 Enterprise LTSC 2019 + Supports Windows 10 Enterprise LTSC 2019 Architecture: x64 .NOTES diff --git a/src/Sophia_Script_for_Windows_10_LTSC_2021/Module/Sophia.psm1 b/src/Sophia_Script_for_Windows_10_LTSC_2021/Module/Sophia.psm1 index 1eb962a5..4939df23 100644 --- a/src/Sophia_Script_for_Windows_10_LTSC_2021/Module/Sophia.psm1 +++ b/src/Sophia_Script_for_Windows_10_LTSC_2021/Module/Sophia.psm1 @@ -3,7 +3,7 @@ Sophia Script is a PowerShell module for Windows 10 & Windows 11 fine-tuning and automating the routine tasks .VERSION - 5.10.0 + 5.20.0 .DATE 29.12.2024 @@ -10129,7 +10129,7 @@ function CleanupTask } # Convert SID to username - $TaskUserAccount = (New-Object System.Security.Principal.SecurityIdentifier($SID)).Translate([System.Security.Principal.NTAccount]).Value -split "\\" | Select-Object -Last 1 + $TaskUserAccount = (New-Object -TypeName System.Security.Principal.SecurityIdentifier($SID)).Translate([System.Security.Principal.NTAccount]).Value -split "\\" | Select-Object -Last 1 if ($TaskUserAccount -ne $env:USERNAME) { @@ -10569,7 +10569,7 @@ function SoftwareDistributionTask } # Convert SID to username - $TaskUserAccount = (New-Object System.Security.Principal.SecurityIdentifier($SID)).Translate([System.Security.Principal.NTAccount]).Value -split "\\" | Select-Object -Last 1 + $TaskUserAccount = (New-Object -TypeName System.Security.Principal.SecurityIdentifier($SID)).Translate([System.Security.Principal.NTAccount]).Value -split "\\" | Select-Object -Last 1 if ($TaskUserAccount -ne $env:USERNAME) { @@ -10887,7 +10887,7 @@ function TempTask } # Convert SID to username - $TaskUserAccount = (New-Object System.Security.Principal.SecurityIdentifier($SID)).Translate([System.Security.Principal.NTAccount]).Value -split "\\" | Select-Object -Last 1 + $TaskUserAccount = (New-Object -TypeName System.Security.Principal.SecurityIdentifier($SID)).Translate([System.Security.Principal.NTAccount]).Value -split "\\" | Select-Object -Last 1 if ($TaskUserAccount -ne $env:USERNAME) { diff --git a/src/Sophia_Script_for_Windows_10_LTSC_2021/Sophia.ps1 b/src/Sophia_Script_for_Windows_10_LTSC_2021/Sophia.ps1 index 8ab90cb5..8ed913d4 100644 --- a/src/Sophia_Script_for_Windows_10_LTSC_2021/Sophia.ps1 +++ b/src/Sophia_Script_for_Windows_10_LTSC_2021/Sophia.ps1 @@ -2,11 +2,16 @@ .SYNOPSIS Default preset file for "Sophia Script for Windows 10 LTSC 2021" - Version: 5.20.0 - Date: 29.12.2024 + .VERSION + 5.20.0 - Copyright (c) 2014—2025 farag, Inestic & lowl1f3 + .DATE + 29.12.2024 + .COPYRIGHT + (c) 2014—2025 farag, Inestic & lowl1f3 + + .THANKS Thanks to all https://forum.ru-board.com members involved .DESCRIPTION @@ -24,7 +29,7 @@ iwr script.sophia.team -useb | iex .NOTES - Supported Windows 10 Enterprise LTSC 2021 + Supports Windows 10 Enterprise LTSC 2021 Architecture: x64 .NOTES diff --git a/src/Sophia_Script_for_Windows_10_PowerShell_7/Module/Sophia.psm1 b/src/Sophia_Script_for_Windows_10_PowerShell_7/Module/Sophia.psm1 index 08da8079..4da3e481 100644 --- a/src/Sophia_Script_for_Windows_10_PowerShell_7/Module/Sophia.psm1 +++ b/src/Sophia_Script_for_Windows_10_PowerShell_7/Module/Sophia.psm1 @@ -12265,7 +12265,7 @@ function CleanupTask } # Convert SID to username - $TaskUserAccount = (New-Object System.Security.Principal.SecurityIdentifier($SID)).Translate([System.Security.Principal.NTAccount]).Value -split "\\" | Select-Object -Last 1 + $TaskUserAccount = (New-Object -TypeName System.Security.Principal.SecurityIdentifier($SID)).Translate([System.Security.Principal.NTAccount]).Value -split "\\" | Select-Object -Last 1 if ($TaskUserAccount -ne $env:USERNAME) { @@ -12705,7 +12705,7 @@ function SoftwareDistributionTask } # Convert SID to username - $TaskUserAccount = (New-Object System.Security.Principal.SecurityIdentifier($SID)).Translate([System.Security.Principal.NTAccount]).Value -split "\\" | Select-Object -Last 1 + $TaskUserAccount = (New-Object -TypeName System.Security.Principal.SecurityIdentifier($SID)).Translate([System.Security.Principal.NTAccount]).Value -split "\\" | Select-Object -Last 1 if ($TaskUserAccount -ne $env:USERNAME) { @@ -13023,7 +13023,7 @@ function TempTask } # Convert SID to username - $TaskUserAccount = (New-Object System.Security.Principal.SecurityIdentifier($SID)).Translate([System.Security.Principal.NTAccount]).Value -split "\\" | Select-Object -Last 1 + $TaskUserAccount = (New-Object -TypeName System.Security.Principal.SecurityIdentifier($SID)).Translate([System.Security.Principal.NTAccount]).Value -split "\\" | Select-Object -Last 1 if ($TaskUserAccount -ne $env:USERNAME) { diff --git a/src/Sophia_Script_for_Windows_10_PowerShell_7/Sophia.ps1 b/src/Sophia_Script_for_Windows_10_PowerShell_7/Sophia.ps1 index 72ec1181..2dbc89b4 100644 --- a/src/Sophia_Script_for_Windows_10_PowerShell_7/Sophia.ps1 +++ b/src/Sophia_Script_for_Windows_10_PowerShell_7/Sophia.ps1 @@ -2,11 +2,16 @@ .SYNOPSIS Default preset file for "Sophia Script for Windows 10 (PowerShell 7)" - Version: 5.20.0 - Date: 29.12.2024 + .VERSION + 5.20.0 - Copyright (c) 2014—2025 farag, Inestic & lowl1f3 + .DATE + 29.12.2024 + .COPYRIGHT + (c) 2014—2025 farag, Inestic & lowl1f3 + + .THANKS Thanks to all https://forum.ru-board.com members involved .DESCRIPTION diff --git a/src/Sophia_Script_for_Windows_11/Module/Sophia.psm1 b/src/Sophia_Script_for_Windows_11/Module/Sophia.psm1 index 28b91564..a48367ba 100644 --- a/src/Sophia_Script_for_Windows_11/Module/Sophia.psm1 +++ b/src/Sophia_Script_for_Windows_11/Module/Sophia.psm1 @@ -11225,7 +11225,7 @@ function CleanupTask } # Convert SID to username - $TaskUserAccount = (New-Object System.Security.Principal.SecurityIdentifier($SID)).Translate([System.Security.Principal.NTAccount]).Value -split "\\" | Select-Object -Last 1 + $TaskUserAccount = (New-Object -TypeName System.Security.Principal.SecurityIdentifier($SID)).Translate([System.Security.Principal.NTAccount]).Value -split "\\" | Select-Object -Last 1 if ($TaskUserAccount -ne $env:USERNAME) { @@ -11686,7 +11686,7 @@ function SoftwareDistributionTask } # Convert SID to username - $TaskUserAccount = (New-Object System.Security.Principal.SecurityIdentifier($SID)).Translate([System.Security.Principal.NTAccount]).Value -split "\\" | Select-Object -Last 1 + $TaskUserAccount = (New-Object -TypeName System.Security.Principal.SecurityIdentifier($SID)).Translate([System.Security.Principal.NTAccount]).Value -split "\\" | Select-Object -Last 1 if ($TaskUserAccount -ne $env:USERNAME) { @@ -12025,7 +12025,7 @@ function TempTask } # Convert SID to username - $TaskUserAccount = (New-Object System.Security.Principal.SecurityIdentifier($SID)).Translate([System.Security.Principal.NTAccount]).Value -split "\\" | Select-Object -Last 1 + $TaskUserAccount = (New-Object -TypeName System.Security.Principal.SecurityIdentifier($SID)).Translate([System.Security.Principal.NTAccount]).Value -split "\\" | Select-Object -Last 1 if ($TaskUserAccount -ne $env:USERNAME) { diff --git a/src/Sophia_Script_for_Windows_11/Sophia.ps1 b/src/Sophia_Script_for_Windows_11/Sophia.ps1 index 4666f2ef..b5b7e4b8 100644 --- a/src/Sophia_Script_for_Windows_11/Sophia.ps1 +++ b/src/Sophia_Script_for_Windows_11/Sophia.ps1 @@ -2,11 +2,16 @@ .SYNOPSIS Default preset file for "Sophia Script for Windows 11" - Version: 6.8.0 - Date: 29.12.2024 + .VERSION + 6.8.0 - Copyright (c) 2014—2025 farag, Inestic & lowl1f3 + .DATE + 29.12.2024 + .COPYRIGHT + (c) 2014—2025 farag, Inestic & lowl1f3 + + .THANKS Thanks to all https://forum.ru-board.com members involved .DESCRIPTION diff --git a/src/Sophia_Script_for_Windows_11_LTSC_2024/Module/Sophia.psm1 b/src/Sophia_Script_for_Windows_11_LTSC_2024/Module/Sophia.psm1 index a58c7b96..15c87461 100644 --- a/src/Sophia_Script_for_Windows_11_LTSC_2024/Module/Sophia.psm1 +++ b/src/Sophia_Script_for_Windows_11_LTSC_2024/Module/Sophia.psm1 @@ -10517,7 +10517,7 @@ function CleanupTask } # Convert SID to username - $TaskUserAccount = (New-Object System.Security.Principal.SecurityIdentifier($SID)).Translate([System.Security.Principal.NTAccount]).Value -split "\\" | Select-Object -Last 1 + $TaskUserAccount = (New-Object -TypeName System.Security.Principal.SecurityIdentifier($SID)).Translate([System.Security.Principal.NTAccount]).Value -split "\\" | Select-Object -Last 1 if ($TaskUserAccount -ne $env:USERNAME) { @@ -10978,7 +10978,7 @@ function SoftwareDistributionTask } # Convert SID to username - $TaskUserAccount = (New-Object System.Security.Principal.SecurityIdentifier($SID)).Translate([System.Security.Principal.NTAccount]).Value -split "\\" | Select-Object -Last 1 + $TaskUserAccount = (New-Object -TypeName System.Security.Principal.SecurityIdentifier($SID)).Translate([System.Security.Principal.NTAccount]).Value -split "\\" | Select-Object -Last 1 if ($TaskUserAccount -ne $env:USERNAME) { @@ -11317,7 +11317,7 @@ function TempTask } # Convert SID to username - $TaskUserAccount = (New-Object System.Security.Principal.SecurityIdentifier($SID)).Translate([System.Security.Principal.NTAccount]).Value -split "\\" | Select-Object -Last 1 + $TaskUserAccount = (New-Object -TypeName System.Security.Principal.SecurityIdentifier($SID)).Translate([System.Security.Principal.NTAccount]).Value -split "\\" | Select-Object -Last 1 if ($TaskUserAccount -ne $env:USERNAME) { diff --git a/src/Sophia_Script_for_Windows_11_LTSC_2024/Sophia.ps1 b/src/Sophia_Script_for_Windows_11_LTSC_2024/Sophia.ps1 index 74449e4e..3df3b78f 100644 --- a/src/Sophia_Script_for_Windows_11_LTSC_2024/Sophia.ps1 +++ b/src/Sophia_Script_for_Windows_11_LTSC_2024/Sophia.ps1 @@ -2,11 +2,16 @@ .SYNOPSIS Default preset file for "Sophia Script for Windows 11 LTSC 2024" - Version: 6.8.0 - Date: 29.12.2024 + .VERSION + 6.8.0 - Copyright (c) 2014—2025 farag, Inestic & lowl1f3 + .DATE + 29.12.2024 + .COPYRIGHT + (c) 2014—2025 farag, Inestic & lowl1f3 + + .THANKS Thanks to all https://forum.ru-board.com members involved .DESCRIPTION diff --git a/src/Sophia_Script_for_Windows_11_PowerShell_7/Module/Sophia.psm1 b/src/Sophia_Script_for_Windows_11_PowerShell_7/Module/Sophia.psm1 index 4832a4fd..a706e3ef 100644 --- a/src/Sophia_Script_for_Windows_11_PowerShell_7/Module/Sophia.psm1 +++ b/src/Sophia_Script_for_Windows_11_PowerShell_7/Module/Sophia.psm1 @@ -11255,7 +11255,7 @@ function CleanupTask } # Convert SID to username - $TaskUserAccount = (New-Object System.Security.Principal.SecurityIdentifier($SID)).Translate([System.Security.Principal.NTAccount]).Value -split "\\" | Select-Object -Last 1 + $TaskUserAccount = (New-Object -TypeName System.Security.Principal.SecurityIdentifier($SID)).Translate([System.Security.Principal.NTAccount]).Value -split "\\" | Select-Object -Last 1 if ($TaskUserAccount -ne $env:USERNAME) { @@ -11716,7 +11716,7 @@ function SoftwareDistributionTask } # Convert SID to username - $TaskUserAccount = (New-Object System.Security.Principal.SecurityIdentifier($SID)).Translate([System.Security.Principal.NTAccount]).Value -split "\\" | Select-Object -Last 1 + $TaskUserAccount = (New-Object -TypeName System.Security.Principal.SecurityIdentifier($SID)).Translate([System.Security.Principal.NTAccount]).Value -split "\\" | Select-Object -Last 1 if ($TaskUserAccount -ne $env:USERNAME) { @@ -12055,7 +12055,7 @@ function TempTask } # Convert SID to username - $TaskUserAccount = (New-Object System.Security.Principal.SecurityIdentifier($SID)).Translate([System.Security.Principal.NTAccount]).Value -split "\\" | Select-Object -Last 1 + $TaskUserAccount = (New-Object -TypeName System.Security.Principal.SecurityIdentifier($SID)).Translate([System.Security.Principal.NTAccount]).Value -split "\\" | Select-Object -Last 1 if ($TaskUserAccount -ne $env:USERNAME) { diff --git a/src/Sophia_Script_for_Windows_11_PowerShell_7/Sophia.ps1 b/src/Sophia_Script_for_Windows_11_PowerShell_7/Sophia.ps1 index eaedafa6..3dd301b7 100644 --- a/src/Sophia_Script_for_Windows_11_PowerShell_7/Sophia.ps1 +++ b/src/Sophia_Script_for_Windows_11_PowerShell_7/Sophia.ps1 @@ -2,11 +2,16 @@ .SYNOPSIS Default preset file for "Sophia Script for Windows 11 (PowerShell 7)" - Version: 6.8.0 - Date: 29.12.2024 + .VERSION + 6.8.0 - Copyright (c) 2014—2025 farag, Inestic & lowl1f3 + .DATE + 29.12.2024 + .COPYRIGHT + (c) 2014—2025 farag, Inestic & lowl1f3 + + .THANKS Thanks to all https://forum.ru-board.com members involved .DESCRIPTION