From 0eb8909d7fd42e43f12e8afe9d1576649e587655 Mon Sep 17 00:00:00 2001 From: Robin Stolpe Date: Sat, 3 Dec 2022 11:17:48 +0100 Subject: [PATCH 1/4] update --- .src/DeleteUserProfile.psd1.source | 2 +- .src/public/function/Get-RSUserProfile.ps1 | 8 ++--- .src/public/function/Remove-RSUserProfile.ps1 | 25 +++++++------- DeleteUserProfile/DeleteUserProfile.psd1 | 2 +- DeleteUserProfile/DeleteUserProfile.psm1 | 33 ++++++++++--------- help/Get-RSUserProfile.md | 8 ++--- help/Remove-RSUserProfile.md | 15 +++++---- ...lyzer_DeleteUserProfile.psm1_2022-12-03.md | 18 ++++++++-- ...ptAnalyzer_Get-RSUserProfile_2022-12-03.md | 6 ++-- ...nalyzer_Remove-RSUserProfile_2022-12-03.md | 12 +++++++ 10 files changed, 78 insertions(+), 51 deletions(-) diff --git a/.src/DeleteUserProfile.psd1.source b/.src/DeleteUserProfile.psd1.source index e86a679..d7b28e3 100644 --- a/.src/DeleteUserProfile.psd1.source +++ b/.src/DeleteUserProfile.psd1.source @@ -124,7 +124,7 @@ ReleaseNotes = 'https://github.com/rstolpe/DeleteUserProfile/releases' # Prerelease string of this module - Prerelease = 'beta' + Prerelease = 'beta2' # Flag to indicate whether the module requires explicit user acceptance for install/update/save RequireLicenseAcceptance = $false diff --git a/.src/public/function/Get-RSUserProfile.ps1 b/.src/public/function/Get-RSUserProfile.ps1 index a913fb3..ac59265 100644 --- a/.src/public/function/Get-RSUserProfile.ps1 +++ b/.src/public/function/Get-RSUserProfile.ps1 @@ -18,7 +18,7 @@ # This will return all of the user profiles saved on the local machine .EXAMPLE - Get-RSUserProfile -ExcludedProfile "Frank, rstolpe" + Get-RSUserProfile -Excluded "Frank, rstolpe" # This will return all of the user profiles saved on the local machine except user profiles that are named Frank and rstolpe .EXAMPLE @@ -30,7 +30,7 @@ # This will return all of the user profiles saved on the remote computers named Win11-Test and Win10 .EXAMPLE - Get-RSUserProfile -ComputerName "Win11-Test" -ExcludedProfile "Frank, rstolpe" + Get-RSUserProfile -ComputerName "Win11-Test" -Excluded "Frank, rstolpe" # This will return all of the user profiles saved on the remote computer "Win11-Test" except user profiles that are named Frank and rstolpe .LINK @@ -51,14 +51,14 @@ [Parameter(Mandatory = $false, HelpMessage = "Enter computername on the computer that you to delete user profiles from, multiple names are accepted if separated with ,")] [string]$ComputerName = "localhost", [Parameter(Mandatory = $false, HelpMessage = "Enter name of user profiles that you want to exclude, multiple input are accepted if separated with ,")] - [string]$ExcludedProfile + [string]$Excluded ) foreach ($Computer in $ComputerName.Split(",").Trim()) { if (Test-WSMan -ComputerName $Computer -ErrorAction SilentlyContinue) { Write-Output "`n== All profiles on $($Computer) ==`n" try { Get-CimInstance -ComputerName $Computer -className Win32_UserProfile | Where-Object { (-Not ($_.Special)) } | Foreach-Object { - if (-Not ($_.LocalPath.split('\')[-1] -in $ExcludedProfile)) { + if (-Not ($_.LocalPath.split('\')[-1] -in $Excluded)) { [PSCustomObject]@{ 'UserName' = $_.LocalPath.split('\')[-1] 'Profile path' = $_.LocalPath diff --git a/.src/public/function/Remove-RSUserProfile.ps1 b/.src/public/function/Remove-RSUserProfile.ps1 index ae67845..f5b8db0 100644 --- a/.src/public/function/Remove-RSUserProfile.ps1 +++ b/.src/public/function/Remove-RSUserProfile.ps1 @@ -7,10 +7,10 @@ Let you delete user profiles from a local computer or remote computer, you can also delete all of the user profiles. You can also exclude profiles. If the profile are loaded you can't delete it. The special Windows profiles are excluded - .PARAMETER Computer + .PARAMETER ComputerName The name of the remote computer you want to display all of the user profiles from. If you want to use it on a local computer you don't need to fill this one out. - .PARAMETER ProfileToDelete + .PARAMETER Delete If you want to delete just one user profile your specify the username here. .PARAMETER DeleteAll @@ -21,11 +21,11 @@ # This will delete all of the user profiles from the local computer your running the script from. .EXAMPLE - Remove-RSUserProfile -ExcludedProfile "User1, User2" -DeleteAll + Remove-RSUserProfile -Excluded "User1, User2" -DeleteAll # This will delete all of the user profiles except user profile User1 and User2 on the local computer .EXAMPLE - Remove-RSUserProfile -ProfileToDelete "User1, User2" + Remove-RSUserProfile -Delete "User1, User2" # This will delete only user profile "User1" and "User2" from the local computer where you run the script from. .EXAMPLE @@ -33,11 +33,11 @@ # This will delete all of the user profiles on the remote computer named "Win11-Test" .EXAMPLE - Remove-RSUserProfile -ComputerName "Win11-test" -ExcludedProfile "User1, User2" -DeleteAll + Remove-RSUserProfile -ComputerName "Win11-test" -Excluded "User1, User2" -DeleteAll # This will delete all of the user profiles except user profile User1 and User2 on the remote computer named "Win11-Test" .EXAMPLE - Remove-RSUserProfile -ComputerName "Win11-test" -ProfileToDelete "User1, User2" + Remove-RSUserProfile -ComputerName "Win11-test" -Delete "User1, User2" # This will delete only user profile "User1" and "User2" from the remote computer named "Win11-Test" .LINK @@ -58,17 +58,18 @@ [Parameter(Mandatory = $false, HelpMessage = "Enter computername on the computer that you to delete user profiles from, multiple names are accepted if separated with ,")] [string]$ComputerName = "localhost", [Parameter(Mandatory = $false, HelpMessage = "Enter the userprofile that you want to delete")] - [string]$ProfileToDelete, + [string]$Delete, [Parameter(Mandatory = $false, HelpMessage = "Use if you want to delete all user profiles")] [switch]$DeleteAll = $false, [Parameter(Mandatory = $false, HelpMessage = "Enter name of user profiles that you want to exclude, multiple input are accepted if separated with ,")] - [string]$ExcludedProfile + [string]$Excluded ) foreach ($Computer in $ComputerName.Split(",").Trim()) { if (Test-WSMan -ComputerName $Computer -ErrorAction SilentlyContinue) { + $AllUserProfiles = Get-CimInstance -ComputerName $Computer -className Win32_UserProfile | Where-Object { (-Not ($_.Special)) } | Select-Object LocalPath, Loaded if ($DeleteAll -eq $True) { - foreach ($Profile in $(Get-CimInstance -ComputerName $Computer -className Win32_UserProfile | Where-Object { (-Not ($_.Special)) } | Select-Object LocalPath, Loaded)) { + foreach ($Profile in $($AllUserProfiles)) { if ($Profile.LocalPath.split('\')[-1] -in $ExcludedProfile) { Write-Output "$($Profile.LocalPath.split('\')[-1]) are excluded so it wont be deleted, proceeding to next profile..." } @@ -91,10 +92,10 @@ } } } - elseif ($DeleteAll -eq $False) { - foreach ($user in $ProfileToDelete.Split(",").Trim()) { + elseif ($DeleteAll -eq $False -and $null -ne $Delete) { + foreach ($user in $Delete.Split(",").Trim()) { if ("$env:SystemDrive\Users\$($user)" -in $AllUserProfiles.LocalPath) { - # check if the userprofile are loaded and if it is show warning + # Add check so the profile are not loaded try { Write-Output "Deleting user profile $($user)..." Get-CimInstance -ComputerName $Computer Win32_UserProfile | Where-Object { $_.LocalPath -eq "$env:SystemDrive\Users\$($user)" } | Remove-CimInstance diff --git a/DeleteUserProfile/DeleteUserProfile.psd1 b/DeleteUserProfile/DeleteUserProfile.psd1 index 7037775..68a79cc 100644 --- a/DeleteUserProfile/DeleteUserProfile.psd1 +++ b/DeleteUserProfile/DeleteUserProfile.psd1 @@ -124,7 +124,7 @@ ReleaseNotes = 'https://github.com/rstolpe/DeleteUserProfile/releases' # Prerelease string of this module - Prerelease = 'beta' + Prerelease = 'beta2' # Flag to indicate whether the module requires explicit user acceptance for install/update/save RequireLicenseAcceptance = $false diff --git a/DeleteUserProfile/DeleteUserProfile.psm1 b/DeleteUserProfile/DeleteUserProfile.psm1 index db1ef04..8c7d38d 100644 --- a/DeleteUserProfile/DeleteUserProfile.psm1 +++ b/DeleteUserProfile/DeleteUserProfile.psm1 @@ -33,7 +33,7 @@ Function Get-RSUserProfile { # This will return all of the user profiles saved on the local machine .EXAMPLE - Get-RSUserProfile -ExcludedProfile "Frank, rstolpe" + Get-RSUserProfile -Excluded "Frank, rstolpe" # This will return all of the user profiles saved on the local machine except user profiles that are named Frank and rstolpe .EXAMPLE @@ -45,7 +45,7 @@ Function Get-RSUserProfile { # This will return all of the user profiles saved on the remote computers named Win11-Test and Win10 .EXAMPLE - Get-RSUserProfile -ComputerName "Win11-Test" -ExcludedProfile "Frank, rstolpe" + Get-RSUserProfile -ComputerName "Win11-Test" -Excluded "Frank, rstolpe" # This will return all of the user profiles saved on the remote computer "Win11-Test" except user profiles that are named Frank and rstolpe .LINK @@ -66,14 +66,14 @@ Function Get-RSUserProfile { [Parameter(Mandatory = $false, HelpMessage = "Enter computername on the computer that you to delete user profiles from, multiple names are accepted if separated with ,")] [string]$ComputerName = "localhost", [Parameter(Mandatory = $false, HelpMessage = "Enter name of user profiles that you want to exclude, multiple input are accepted if separated with ,")] - [string]$ExcludedProfile + [string]$Excluded ) foreach ($Computer in $ComputerName.Split(",").Trim()) { if (Test-WSMan -ComputerName $Computer -ErrorAction SilentlyContinue) { Write-Output "`n== All profiles on $($Computer) ==`n" try { Get-CimInstance -ComputerName $Computer -className Win32_UserProfile | Where-Object { (-Not ($_.Special)) } | Foreach-Object { - if (-Not ($_.LocalPath.split('\')[-1] -in $ExcludedProfile)) { + if (-Not ($_.LocalPath.split('\')[-1] -in $Excluded)) { [PSCustomObject]@{ 'UserName' = $_.LocalPath.split('\')[-1] 'Profile path' = $_.LocalPath @@ -102,10 +102,10 @@ Function Remove-RSUserProfile { Let you delete user profiles from a local computer or remote computer, you can also delete all of the user profiles. You can also exclude profiles. If the profile are loaded you can't delete it. The special Windows profiles are excluded - .PARAMETER Computer + .PARAMETER ComputerName The name of the remote computer you want to display all of the user profiles from. If you want to use it on a local computer you don't need to fill this one out. - .PARAMETER ProfileToDelete + .PARAMETER Delete If you want to delete just one user profile your specify the username here. .PARAMETER DeleteAll @@ -116,11 +116,11 @@ Function Remove-RSUserProfile { # This will delete all of the user profiles from the local computer your running the script from. .EXAMPLE - Remove-RSUserProfile -ExcludedProfile "User1, User2" -DeleteAll + Remove-RSUserProfile -Excluded "User1, User2" -DeleteAll # This will delete all of the user profiles except user profile User1 and User2 on the local computer .EXAMPLE - Remove-RSUserProfile -ProfileToDelete "User1, User2" + Remove-RSUserProfile -Delete "User1, User2" # This will delete only user profile "User1" and "User2" from the local computer where you run the script from. .EXAMPLE @@ -128,11 +128,11 @@ Function Remove-RSUserProfile { # This will delete all of the user profiles on the remote computer named "Win11-Test" .EXAMPLE - Remove-RSUserProfile -ComputerName "Win11-test" -ExcludedProfile "User1, User2" -DeleteAll + Remove-RSUserProfile -ComputerName "Win11-test" -Excluded "User1, User2" -DeleteAll # This will delete all of the user profiles except user profile User1 and User2 on the remote computer named "Win11-Test" .EXAMPLE - Remove-RSUserProfile -ComputerName "Win11-test" -ProfileToDelete "User1, User2" + Remove-RSUserProfile -ComputerName "Win11-test" -Delete "User1, User2" # This will delete only user profile "User1" and "User2" from the remote computer named "Win11-Test" .LINK @@ -153,17 +153,18 @@ Function Remove-RSUserProfile { [Parameter(Mandatory = $false, HelpMessage = "Enter computername on the computer that you to delete user profiles from, multiple names are accepted if separated with ,")] [string]$ComputerName = "localhost", [Parameter(Mandatory = $false, HelpMessage = "Enter the userprofile that you want to delete")] - [string]$ProfileToDelete, + [string]$Delete, [Parameter(Mandatory = $false, HelpMessage = "Use if you want to delete all user profiles")] [switch]$DeleteAll = $false, [Parameter(Mandatory = $false, HelpMessage = "Enter name of user profiles that you want to exclude, multiple input are accepted if separated with ,")] - [string]$ExcludedProfile + [string]$Excluded ) foreach ($Computer in $ComputerName.Split(",").Trim()) { if (Test-WSMan -ComputerName $Computer -ErrorAction SilentlyContinue) { + $AllUserProfiles = Get-CimInstance -ComputerName $Computer -className Win32_UserProfile | Where-Object { (-Not ($_.Special)) } | Select-Object LocalPath, Loaded if ($DeleteAll -eq $True) { - foreach ($Profile in $(Get-CimInstance -ComputerName $Computer -className Win32_UserProfile | Where-Object { (-Not ($_.Special)) } | Select-Object LocalPath, Loaded)) { + foreach ($Profile in $($AllUserProfiles)) { if ($Profile.LocalPath.split('\')[-1] -in $ExcludedProfile) { Write-Output "$($Profile.LocalPath.split('\')[-1]) are excluded so it wont be deleted, proceeding to next profile..." } @@ -186,10 +187,10 @@ Function Remove-RSUserProfile { } } } - elseif ($DeleteAll -eq $False) { - foreach ($user in $ProfileToDelete.Split(",").Trim()) { + elseif ($DeleteAll -eq $False -and $null -ne $Delete) { + foreach ($user in $Delete.Split(",").Trim()) { if ("$env:SystemDrive\Users\$($user)" -in $AllUserProfiles.LocalPath) { - # check if the userprofile are loaded and if it is show warning + # Add check so the profile are not loaded try { Write-Output "Deleting user profile $($user)..." Get-CimInstance -ComputerName $Computer Win32_UserProfile | Where-Object { $_.LocalPath -eq "$env:SystemDrive\Users\$($user)" } | Remove-CimInstance diff --git a/help/Get-RSUserProfile.md b/help/Get-RSUserProfile.md index 47ea6bc..c64d5b7 100644 --- a/help/Get-RSUserProfile.md +++ b/help/Get-RSUserProfile.md @@ -7,7 +7,7 @@ SYNOPSIS SYNTAX - Get-RSUserProfile [[-ComputerName] ] [[-ExcludedProfile] ] [] + Get-RSUserProfile [[-ComputerName] ] [[-Excluded] ] [] DESCRIPTION @@ -25,7 +25,7 @@ PARAMETERS Accept pipeline input? false Accept wildcard characters? false - -ExcludedProfile + -Excluded Required? false Position? 2 @@ -66,7 +66,7 @@ NOTES -------------------------- EXAMPLE 2 -------------------------- - PS > Get-RSUserProfile -ExcludedProfile "Frank, rstolpe" + PS > Get-RSUserProfile -Excluded "Frank, rstolpe" # This will return all of the user profiles saved on the local machine except user profiles that are named Frank and rstolpe @@ -96,7 +96,7 @@ NOTES -------------------------- EXAMPLE 5 -------------------------- - PS > Get-RSUserProfile -ComputerName "Win11-Test" -ExcludedProfile "Frank, rstolpe" + PS > Get-RSUserProfile -ComputerName "Win11-Test" -Excluded "Frank, rstolpe" # This will return all of the user profiles saved on the remote computer "Win11-Test" except user profiles that are named Frank and rstolpe diff --git a/help/Remove-RSUserProfile.md b/help/Remove-RSUserProfile.md index f6e6ac3..13cf349 100644 --- a/help/Remove-RSUserProfile.md +++ b/help/Remove-RSUserProfile.md @@ -7,7 +7,7 @@ SYNOPSIS SYNTAX - Remove-RSUserProfile [[-ComputerName] ] [[-ProfileToDelete] ] [-DeleteAll] [[-ExcludedProfile] ] [] + Remove-RSUserProfile [[-ComputerName] ] [[-Delete] ] [-DeleteAll] [[-Excluded] ] [] DESCRIPTION @@ -17,6 +17,7 @@ DESCRIPTION PARAMETERS -ComputerName + The name of the remote computer you want to display all of the user profiles from. If you want to use it on a local computer you don't need to fill this one out. Required? false Position? 1 @@ -24,7 +25,7 @@ PARAMETERS Accept pipeline input? false Accept wildcard characters? false - -ProfileToDelete + -Delete If you want to delete just one user profile your specify the username here. Required? false @@ -42,7 +43,7 @@ PARAMETERS Accept pipeline input? false Accept wildcard characters? false - -ExcludedProfile + -Excluded Required? false Position? 3 @@ -83,7 +84,7 @@ NOTES -------------------------- EXAMPLE 2 -------------------------- - PS > Remove-RSUserProfile -ExcludedProfile "User1, User2" -DeleteAll + PS > Remove-RSUserProfile -Excluded "User1, User2" -DeleteAll # This will delete all of the user profiles except user profile User1 and User2 on the local computer @@ -93,7 +94,7 @@ NOTES -------------------------- EXAMPLE 3 -------------------------- - PS > Remove-RSUserProfile -ProfileToDelete "User1, User2" + PS > Remove-RSUserProfile -Delete "User1, User2" # This will delete only user profile "User1" and "User2" from the local computer where you run the script from. @@ -113,7 +114,7 @@ NOTES -------------------------- EXAMPLE 5 -------------------------- - PS > Remove-RSUserProfile -ComputerName "Win11-test" -ExcludedProfile "User1, User2" -DeleteAll + PS > Remove-RSUserProfile -ComputerName "Win11-test" -Excluded "User1, User2" -DeleteAll # This will delete all of the user profiles except user profile User1 and User2 on the remote computer named "Win11-Test" @@ -123,7 +124,7 @@ NOTES -------------------------- EXAMPLE 6 -------------------------- - PS > Remove-RSUserProfile -ComputerName "Win11-test" -ProfileToDelete "User1, User2" + PS > Remove-RSUserProfile -ComputerName "Win11-test" -Delete "User1, User2" # This will delete only user profile "User1" and "User2" from the remote computer named "Win11-Test" diff --git a/test/PSScriptAnalyzer_DeleteUserProfile.psm1_2022-12-03.md b/test/PSScriptAnalyzer_DeleteUserProfile.psm1_2022-12-03.md index 2eb634f..5ca721d 100644 --- a/test/PSScriptAnalyzer_DeleteUserProfile.psm1_2022-12-03.md +++ b/test/PSScriptAnalyzer_DeleteUserProfile.psm1_2022-12-03.md @@ -1,13 +1,25 @@  Line : 69 Column : 17 -Message : The parameter 'ExcludedProfile' has been declared but not used. -Extent : $ExcludedProfile +Message : The parameter 'Excluded' has been declared but not used. +Extent : $Excluded RuleName : PSReviewUnusedParameter Severity : Warning ScriptName : DeleteUserProfile.psm1 ScriptPath : /Users/rstolpe/Dev/GitHub/DeleteUserProfile/DeleteUserProfile/DeleteUserProfile.psm1 -RuleSuppressionID : ExcludedProfile +RuleSuppressionID : Excluded +SuggestedCorrections : +IsSuppressed : False + +Line : 160 +Column : 17 +Message : The parameter 'Excluded' has been declared but not used. +Extent : $Excluded +RuleName : PSReviewUnusedParameter +Severity : Warning +ScriptName : DeleteUserProfile.psm1 +ScriptPath : /Users/rstolpe/Dev/GitHub/DeleteUserProfile/DeleteUserProfile/DeleteUserProfile.psm1 +RuleSuppressionID : Excluded SuggestedCorrections : IsSuppressed : False diff --git a/test/PSScriptAnalyzer_Get-RSUserProfile_2022-12-03.md b/test/PSScriptAnalyzer_Get-RSUserProfile_2022-12-03.md index b1a975a..b78de91 100644 --- a/test/PSScriptAnalyzer_Get-RSUserProfile_2022-12-03.md +++ b/test/PSScriptAnalyzer_Get-RSUserProfile_2022-12-03.md @@ -1,13 +1,13 @@  Line : 54 Column : 17 -Message : The parameter 'ExcludedProfile' has been declared but not used. -Extent : $ExcludedProfile +Message : The parameter 'Excluded' has been declared but not used. +Extent : $Excluded RuleName : PSReviewUnusedParameter Severity : Warning ScriptName : Get-RSUserProfile.ps1 ScriptPath : /Users/rstolpe/Dev/GitHub/DeleteUserProfile/.src/public/function/Get-RSUserProfile.ps1 -RuleSuppressionID : ExcludedProfile +RuleSuppressionID : Excluded SuggestedCorrections : IsSuppressed : False diff --git a/test/PSScriptAnalyzer_Remove-RSUserProfile_2022-12-03.md b/test/PSScriptAnalyzer_Remove-RSUserProfile_2022-12-03.md index 22057ed..9f5a1e0 100644 --- a/test/PSScriptAnalyzer_Remove-RSUserProfile_2022-12-03.md +++ b/test/PSScriptAnalyzer_Remove-RSUserProfile_2022-12-03.md @@ -1,4 +1,16 @@  +Line : 65 +Column : 17 +Message : The parameter 'Excluded' has been declared but not used. +Extent : $Excluded +RuleName : PSReviewUnusedParameter +Severity : Warning +ScriptName : Remove-RSUserProfile.ps1 +ScriptPath : /Users/rstolpe/Dev/GitHub/DeleteUserProfile/.src/public/function/Remove-RSUserProfile.ps1 +RuleSuppressionID : Excluded +SuggestedCorrections : +IsSuppressed : False + Line : 1 Column : 10 Message : Function 'Remove-RSUserProfile' has verb that could change system state. Therefore, the function has to support 'ShouldProcess'. From 63c2d06d50c2d95637b753dd6ac7034db5aa4322 Mon Sep 17 00:00:00 2001 From: Robin Stolpe Date: Sat, 3 Dec 2022 11:18:40 +0100 Subject: [PATCH 2/4] update --- README.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 0d45b56..05558be 100644 --- a/README.md +++ b/README.md @@ -51,7 +51,7 @@ Get-RSUserProfile Return all user profiles that are saved on the local computer ``` -Get-RSUserProfile -ExcludedProfile "Frank, rstolpe" +Get-RSUserProfile -Excluded "Frank, rstolpe" ``` This will return all of the user profiles saved on the local machine except user profiles that are named Frank and rstolpe @@ -69,11 +69,11 @@ Remove-RSUserProfile -DeleteAll This will delete all of the user profiles from the localhost / computer your running the module from. ``` -Remove-RSUserProfile -ExcludedProfile "User1, User2" -DeleteAll +Remove-RSUserProfile -Excluded "User1, User2" -DeleteAll ``` This will delete all of the user profiles except user profile User1 and User2 on the local computer ``` -Remove-RSUserProfile -ProfileToDelete "User1, User2" +Remove-RSUserProfile -Delete "User1, User2" ``` This will delete only user profile "User1" and "User2" from the local computer where you run the script from. \ No newline at end of file From b0801025c034b28f9045695866b70e56273858bd Mon Sep 17 00:00:00 2001 From: Robin Stolpe Date: Sat, 3 Dec 2022 11:28:23 +0100 Subject: [PATCH 3/4] Update --- .src/public/function/Remove-RSUserProfile.ps1 | 4 ++-- DeleteUserProfile/DeleteUserProfile.psm1 | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.src/public/function/Remove-RSUserProfile.ps1 b/.src/public/function/Remove-RSUserProfile.ps1 index f5b8db0..075e38a 100644 --- a/.src/public/function/Remove-RSUserProfile.ps1 +++ b/.src/public/function/Remove-RSUserProfile.ps1 @@ -82,7 +82,7 @@ try { Write-Output "Deleting user profile $($Profile.LocalPath.split('\')[-1])..." Get-CimInstance -ComputerName $Computer Win32_UserProfile | Where-Object { $_.LocalPath -eq $Profile.LocalPath } | Remove-CimInstance - Write-Output "The user profile $($Profile.LocalPath.split('\')[-1]) are now deleted!" -ForegroundColor Green + Write-Output "The user profile $($Profile.LocalPath.split('\')[-1]) are now deleted!" } catch { Write-Error "$($PSItem.Exception)" @@ -99,7 +99,7 @@ try { Write-Output "Deleting user profile $($user)..." Get-CimInstance -ComputerName $Computer Win32_UserProfile | Where-Object { $_.LocalPath -eq "$env:SystemDrive\Users\$($user)" } | Remove-CimInstance - Write-Output "The user profile $($user) are now deleted!" -ForegroundColor Green + Write-Output "The user profile $($user) are now deleted!" } catch { Write-Error "$($PSItem.Exception)" diff --git a/DeleteUserProfile/DeleteUserProfile.psm1 b/DeleteUserProfile/DeleteUserProfile.psm1 index 8c7d38d..32fd8f5 100644 --- a/DeleteUserProfile/DeleteUserProfile.psm1 +++ b/DeleteUserProfile/DeleteUserProfile.psm1 @@ -177,7 +177,7 @@ Function Remove-RSUserProfile { try { Write-Output "Deleting user profile $($Profile.LocalPath.split('\')[-1])..." Get-CimInstance -ComputerName $Computer Win32_UserProfile | Where-Object { $_.LocalPath -eq $Profile.LocalPath } | Remove-CimInstance - Write-Output "The user profile $($Profile.LocalPath.split('\')[-1]) are now deleted!" -ForegroundColor Green + Write-Output "The user profile $($Profile.LocalPath.split('\')[-1]) are now deleted!" } catch { Write-Error "$($PSItem.Exception)" @@ -194,7 +194,7 @@ Function Remove-RSUserProfile { try { Write-Output "Deleting user profile $($user)..." Get-CimInstance -ComputerName $Computer Win32_UserProfile | Where-Object { $_.LocalPath -eq "$env:SystemDrive\Users\$($user)" } | Remove-CimInstance - Write-Output "The user profile $($user) are now deleted!" -ForegroundColor Green + Write-Output "The user profile $($user) are now deleted!" } catch { Write-Error "$($PSItem.Exception)" From 44eef3078531558fd7382d8c37a9e30d2a0efa86 Mon Sep 17 00:00:00 2001 From: Robin Stolpe Date: Sat, 3 Dec 2022 12:35:43 +0100 Subject: [PATCH 4/4] update --- .src/DeleteUserProfile.psd1.source | 2 +- DeleteUserProfile/DeleteUserProfile.psd1 | 2 +- README.md | 1 - 3 files changed, 2 insertions(+), 3 deletions(-) diff --git a/.src/DeleteUserProfile.psd1.source b/.src/DeleteUserProfile.psd1.source index d7b28e3..2637337 100644 --- a/.src/DeleteUserProfile.psd1.source +++ b/.src/DeleteUserProfile.psd1.source @@ -124,7 +124,7 @@ ReleaseNotes = 'https://github.com/rstolpe/DeleteUserProfile/releases' # Prerelease string of this module - Prerelease = 'beta2' + # Prerelease = 'beta2' # Flag to indicate whether the module requires explicit user acceptance for install/update/save RequireLicenseAcceptance = $false diff --git a/DeleteUserProfile/DeleteUserProfile.psd1 b/DeleteUserProfile/DeleteUserProfile.psd1 index 68a79cc..e8114f2 100644 --- a/DeleteUserProfile/DeleteUserProfile.psd1 +++ b/DeleteUserProfile/DeleteUserProfile.psd1 @@ -124,7 +124,7 @@ ReleaseNotes = 'https://github.com/rstolpe/DeleteUserProfile/releases' # Prerelease string of this module - Prerelease = 'beta2' + # Prerelease = 'beta2' # Flag to indicate whether the module requires explicit user acceptance for install/update/save RequireLicenseAcceptance = $false diff --git a/README.md b/README.md index 05558be..69b4d36 100644 --- a/README.md +++ b/README.md @@ -23,7 +23,6 @@ If you use this module on a remote computer you need to make sure that you have * [Webpage/Blog](https://www.stolpe.io) * [Twitter](https://twitter.com/rstolpes) * [LinkedIn](https://www.linkedin.com/in/rstolpe/) -* [YouTube]() * [PowerShell Gallery](https://www.powershellgallery.com/profiles/rstolpe) # Help