-
-
Notifications
You must be signed in to change notification settings - Fork 706
Expand file tree
/
Copy pathMiscellaneous.psm1
More file actions
33 lines (27 loc) · 992 Bytes
/
Miscellaneous.psm1
File metadata and controls
33 lines (27 loc) · 992 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
# Add Music & Videos to Home (Fix missing folders in Quick Access)
function Add-MusicVideosToHome {
$o = New-Object -ComObject shell.application
$currentPins = $o.Namespace('shell:::{679f85cb-0220-4080-b29b-5540cc05aab6}').Items() | ForEach-Object { $_.Path }
foreach ($path in @(
[Environment]::GetFolderPath('MyVideos'),
[Environment]::GetFolderPath('MyMusic')
)) {
if ($currentPins -notcontains $path) {
$o.Namespace($path).Self.InvokeVerb('pintohome')
}
}
}
# Configure Time Servers for better accuracy
function Set-TimeServers {
Start-Service -Name "w32time" -ErrorAction SilentlyContinue
w32tm /config /syncfromflags:manual /manualpeerlist:"0.pool.ntp.org 1.pool.ntp.org 2.pool.ntp.org 3.pool.ntp.org"
w32tm /config /update
w32tm /resync
}
# Rebuild Performance Counters
function Reset-PerformanceCounters {
lodctr /r
lodctr /r
winmgmt /resyncperf
}
Export-ModuleMember -Function @()