$ uname -r
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
# Get-ApplicationDeploymentTypes | Get-ApplicationDeploymentTypeInstallContent | Get-ContentCacheLocation | |
# Get-CCMApplication | Get-ApplicationDeploymentTypes | Get-ApplicationDeploymentTypeInstallContent | Get-ContentCacheLocation | |
function Get-ContentCacheLocation { | |
param ( | |
[Parameter(ValueFromPipeline, ValueFromPipelineByPropertyName)] | |
[Alias('PackageID', 'PKG_PackageID')] | |
[string]$contentId | |
) | |
process { | |
Get-CimInstance -Namespace root/ccm/SoftMgmtAgent -Query "SELECT Location FROM CacheInfoEx WHERE ContentID='$contentId'" | Select-Object -ExpandProperty Location |
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-NativeCommand { | |
<# | |
.SYNOPSIS | |
Invoke a native command (.exe) as a new process. | |
.DESCRIPTION | |
Invoke-NativeCommand executes an arbitrary executable as a new process. Both the standard | |
and error output streams are redirected. | |
Error out is written as a single non-terminating error. ErrorAction can be used to raise |
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 Measure-ChildItem { | |
<# | |
.SYNOPSIS | |
Recursively measures the size of a directory. | |
.DESCRIPTION | |
Recursively measures the size of a directory. | |
Measure-ChildItem uses win32 functions, returning a minimal amount of information to gain speed. Once started, the operation cannot be interrupted by using Control and C. The more items present in a directory structure the longer this command will take. | |
This command supports paths longer than 260 characters. |
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
#Requires -Version 7 | |
# Version 1.2.13 | |
# check if newer version | |
$gistUrl = "https://api.github.com/gists/a208d2bd924691bae7ec7904cab0bd8e" | |
$latestVersionFile = [System.IO.Path]::Combine("$HOME",'.latest_profile_version') | |
$versionRegEx = "# Version (?<version>\d+\.\d+\.\d+)" | |
if ([System.IO.File]::Exists($latestVersionFile)) { |
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
# (Get-CimClass -Namespace root\ccm -ClassName sms_client).CimClassMethods['ResetPolicy'].Parameters | |
Invoke-CimMethod -Namespace root\ccm -ClassName sms_client -Name ResetPolicy -Arguments @{ uFlags = ([UInt32]1) } | |
Restart-Service CcmExec |
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 Get-InstalledSoftware { | |
<# | |
.SYNOPSIS | |
Get all installed from the Uninstall keys in the registry. | |
.DESCRIPTION | |
Read a list of installed software from each Uninstall key. | |
This function provides an alternative to using Win32_Product. | |
.EXAMPLE | |
Get-InstalledSoftware |
To remove a submodule you need to:
- Delete the relevant section from the .gitmodules file.
- Stage the .gitmodules changes git add .gitmodules
- Delete the relevant section from .git/config.
- Run git rm --cached path_to_submodule (no trailing slash).
- Run rm -rf .git/modules/path_to_submodule (no trailing slash).
- Commit git commit -m "Removed submodule "
- Delete the now untracked submodule files rm -rf path_to_submodule