Browse Source

Update Win 10.ps1

pull/3/head
farag2 6 years ago
committed by GitHub
parent
commit
15775dc4ab
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 9
      Win 10.ps1

9
Win 10.ps1

@ -757,14 +757,13 @@ $DiskCount = (Get-Disk | Where-Object {$_.BusType -ne "USB"}).Number.Count
IF ($DiskCount -eq 1) IF ($DiskCount -eq 1)
{ {
# Один физический диск # Один физический диск
$drive = (Get-Disk | Where-Object {$_.BusType -ne "USB" -and $_.IsBoot -eq $true} | Get-Partition | Get-Volume).DriveLetter $drive = (Get-Disk | Where-Object {$_.BusType -ne "USB" -and $_.IsBoot -eq $true} | Get-Partition | Get-Volume | Where-Object {$_.DriveLetter -ne $null}).DriveLetter + $_ + ':'
} }
Else Else
{ {
# Больше одного физического диска # Больше одного физического диска
$drive = (Get-Disk | Where-Object {$_.BusType -ne "USB" -and $_.IsBoot -eq $false} | Get-Partition | Get-Volume).DriveLetter $drive = (Get-Disk | Where-Object {$_.BusType -ne "USB" -and $_.IsBoot -eq $false} | Get-Partition | Get-Volume | Where-Object {$_.DriveLetter -ne $null}).DriveLetter + $_ + ':'
} }
$drive = $drive | ForEach-Object {$_ + ':'} | Join-Path -ChildPath $_ -Resolve -ErrorAction SilentlyContinue
function KnownFolderPath function KnownFolderPath
{ {
Param ( Param (
@ -793,7 +792,7 @@ function KnownFolderPath
Attrib +r $Path Attrib +r $Path
} }
$Downloads = Get-ItemPropertyValue -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders" -Name "{374DE290-123F-4565-9164-39C4925E467B}" $Downloads = Get-ItemPropertyValue -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders" -Name "{374DE290-123F-4565-9164-39C4925E467B}"
IF ($Downloads -ne "D:\Загрузки") IF ($Downloads -ne "$drive\Загрузки")
{ {
IF (!(Test-Path $drive\Загрузки)) IF (!(Test-Path $drive\Загрузки))
{ {
@ -803,7 +802,7 @@ IF ($Downloads -ne "D:\Загрузки")
New-ItemProperty -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders" -Name "{7D83EE9B-2244-4E70-B1F5-5393042AF1E4}" -Type ExpandString -Value "$drive\Загрузки" -Force New-ItemProperty -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders" -Name "{7D83EE9B-2244-4E70-B1F5-5393042AF1E4}" -Type ExpandString -Value "$drive\Загрузки" -Force
} }
$Documents = Get-ItemPropertyValue -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders" -Name Personal $Documents = Get-ItemPropertyValue -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders" -Name Personal
IF ($Documents -ne "D:\Документы") IF ($Documents -ne "$drive\Документы")
{ {
IF (!(Test-Path $drive\Документы)) IF (!(Test-Path $drive\Документы))
{ {

Loading…
Cancel
Save