Access is denied.
+ CategoryInfo : NotSpecified: (:) [Add-WindowsCapability], COMException
+ FullyQualifiedErrorId : Microsoft.Dism.Commands.AddWindowsCapabilityCommand
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function Send-SyslogMessage { | |
#region Parameters | |
[CmdletBinding(PositionalBinding = $false, | |
ConfirmImpact = 'Medium')] | |
[Alias()] | |
[OutputType([String])] | |
Param | |
( | |
# The message to send |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<# | |
.SYNOPSIS | |
Sends an IP message (TCP or UDP) to a specified endpoint and port. | |
.DESCRIPTION | |
The Send-IpMessage function sends a message over the specified IP protocol (TCP or UDP) to a specified endpoint and port. | |
It supports sending messages with or without a CRLF (Carriage Return Line Feed) at the end of the message. | |
.PARAMETER EndPoint | |
The endpoint (IP address or hostname) to which the message will be sent. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function Invoke-TcpListener { | |
<# | |
.SYNOPSIS | |
Starts a TCP listener on a specified port. | |
.DESCRIPTION | |
This function starts a TCP listener on a specified port, accepts incoming connections, | |
reads messages, and writes them to the terminal. It stops listening if the received | |
message is "exit". | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Connect to the SharePoint site | |
Connect-PnPOnline -Url "YourSiteURL" -Credentials | |
# Specify the name of your Document Library | |
$DocLib = 'Documents' | |
# Retrieve all items from the Document Library in batches | |
$ListItems = Get-PnPListItem -List $DocLib -PageSize 2000 -ScriptBlock { | |
Param($items) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<# | |
.SYNOPSIS | |
Updates the Azure Files Storage Sync Agent on specified computers. | |
.DESCRIPTION | |
This cmdlet updates the Azure Files Storage Sync Agent on the specified computers by retrieving the installation directory from the registry, importing the update agent module DLL, and running the update process. | |
.PARAMETER ComputerName | |
Specifies the computer name on which the Azure Files Storage Sync Agent will be updated. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<# | |
.Synopsis | |
Microsoft 365 Group memberships for a user or summary report | |
.DESCRIPTION | |
Output a list of a user's modern group memberships (Teams, Engage, Planner, Groups) or summary report | |
.EXAMPLE | |
Get-M365GroupsForUser -UserName pvenkman | sort DisplayName | select DisplayName,Description | |
.EXAMPLE | |
Get-M365GroupsForUser -UserName pvenkman -Report | where Owners -like "*rsantz*" | |
.EXAMPLE |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<# | |
.Synopsis | |
Display Microsoft 365 Groups owned by a user. | |
.DESCRIPTION | |
Display modern groups (Microsoft 365 Group, Microsoft Teams, Planner, Viva Engage, etc.) | |
of which the user is an owner. Script requires synchronization of modern groups to the | |
operator's Active Directory and the operator has permissions to read user object attributes. | |
The script requires the PowerShell module "ActiveDirectory". | |
.EXAMPLE | |
Get-M365GroupsOwned -UserName pvenkman | select DisplayName,Name |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# PS-BGInfo | |
# Powershell script that updates the background image with a random image from a folder and writes out system info text to it. | |
# run as a lower priority task | |
[System.Threading.Thread]::CurrentThread.Priority = 'BelowNormal' | |
# Configuration: | |
# Font Family name | |
$font="Input" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Name of Hyper-V VM | |
$vm = "MyVMName" | |
# Total VRAM of physical GPU (GPU-P) | |
$TotalGPUpVram = 6Gb | |
# Percent of physical GPU resources to allocate to virtual GPU in the VM | |
[int]$GPUpAllocationPercent = 25 | |
# Calculate the high memory mapped IO value based on total GPU-P VRAM |
NewerOlder