This file contains hidden or 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
| $RebootPending = $false | |
| #Check for 'Reboot Required' registry key | |
| if(Test-Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Component Based Servicing\RebootPending" -ea SilentlyContinue) { | |
| $RebootPending = $true |
This file contains hidden or 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
| $cred = Get-credential | |
| New-PSDrive -Name mounted_dokumente -PSProvider FileSystem -Credential $cred -Root "XXXXXXXXXXXXX" |
This file contains hidden or 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
| ## Set logging variables: | |
| $script_log_dir = "C:\Logs" | |
| $script_name = $MyInvocation.MyCommand.Definition | Split-Path -Leaf | |
| $script_short_name = $script_name.split(".")[0] | |
| $script_path = $MyInvocation.MyCommand.Definition | Split-Path -Parent | |
| $script_registry_hive = "HKLM:\Software\HG3" | |
| $script_logfile = $script_log_dir + "\" + $script_short_name + ".log" | |
| $script_logfile_with_date = $script_log_dir + "\" + $script_short_name + "-" + (Get-Date -Format yyyy-MM-dd) + ".log" | |
| $script_logging_enabled = $false |
This file contains hidden or 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
| Remove-Variable * -ErrorAction SilentlyContinue; Remove-Module *; $error.Clear(); |
This file contains hidden or 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
| Set-PSReadLineKeyHandler -Key UpArrow -Function HistorySearchBackward | |
| Set-PSReadLineKeyHandler -Key DownArrow -Function HistorySearchForward | |
| Set-PSReadLineOption -Colors @{emphasis = '#ff0000'; inlinePrediction = 'magenta'} | |
| Set-PSReadLineOption -HistoryNoDuplicates |
This file contains hidden or 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
| Get-WMIObject Win32_PnPSignedDriver | where {$_.Devicename -like "*Realtek*"} | select-object -Property * | Export-CSV ZBNB31156_RealtekDriver.csv | |
| Get-WMIObject Win32_PnPSignedDriver | where {$_.Devicename -like "*Smart*"} | select-object -Property * | Export-CSV -Path ZBNB31156_Driver_SmartSound.csv |
This file contains hidden or 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
| Get-ADComputer -Filter 'operatingsystem -like "Windows 8*" -and enabled -eq "true"' ` | |
| -Properties Name,Operatingsystem,OperatingSystemVersion,IPv4Address,LastLogonDate | Select-object -Property Name |
This file contains hidden or 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 Clean-MacAddress { | |
| <# | |
| .SYNOPSIS | |
| Function to cleanup a MACAddress string | |
| .DESCRIPTION | |
| Function to cleanup a MACAddress string | |
| .PARAMETER MacAddress | |
| Specifies the MacAddress | |
| .PARAMETER Separator | |
| Specifies the separator every two characters |
This file contains hidden or 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
| ## Input validation | |
| ## Convert String to Int and check if valid Int Number | |
| [int]$number = "12345" | |
| if ($number -is [int]){ | |
| $NumberIsIntValue = $true | |
| } |
This file contains hidden or 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 Get-SCCMCollectionsInFolder | |
| { | |
| <# | |
| .SYNOPSIS | |
| Returns all the collections located in the specified folder ID. | |
| .DESCRIPTION | |
| Connects to the specified site server and retrieves the details of the specified folder as output that in term can be used for other functions. | |
| This function is usable for Device or User collections any other items will need different WMI queries and these would be best added to a seperate function. | |
| .EXAMPLE |
NewerOlder