Pages

Wednesday, June 26, 2024

Set-ExecutionPolicy

 The Set-ExecutionPolicy cmdlet change the user preference for the Windows PowerShell execution policy.


Set-ExecutionPolicy [-ExecutionPolicy*] {Unrestricted | RemoteSigned | AllSigned | Restricted | Default | Bypass |Undefined} [[-Scope] {Process | CurrentUser | LocalMachine | UserPolicy | MachinePolicy}] [-Confirm] [-Force][-WhatIf] [<CommonParameters>]


Examples

Set the shell execution policy:


PS C:\> Set-ExecutionPolicy -ExecutionPolicy RemoteSigned


The command uses the Force parameter to suppress the user prompt.


Set the scope for an execution policy:


PS C:\> Set-ExecutionPolicy -Scope CurrentUser -ExecutionPolicy AllSigned -Force

PS C:\> Get-ExecutionPolicy -List



Remove the execution policy for the current user:


PS C:\> Set-ExecutionPolicy -Scope CurrentUser -ExecutionPolicy Undefined

Other Issues:

When you run an .ps1 PowerShell script you will get the message saying “.ps1 is not digitally signed. The script will not execute on the system.”


To fix this issue you have to run the following command to run Set-ExecutionPolicy and change the Execution Policy setting.


Set-ExecutionPolicy -Scope Process -ExecutionPolicy Bypass


Friday, June 7, 2024

No delete option for a SharePoint folder

 If you use the global admin account and am running into a problem with a folder on a SharePoint site.


-There is nothing inside of the folders.

-I have listed as the owner of the folders.

-There was previously a Teams channels with the same name which has been deleted.

-There is another folder in the same site at the top of the directory that does have the delete options.

Can someone please provide guidance as to why this folder cannot be deleted?





Solution:


As far as I know, if an folder is associated with a channel in Teams, we cannot directly delete the folders (there is no Delete option) in SharePoint, we need to firstly delete the channel from Teams, then go back to SharePoint, the Delete option will appear. you can try it.