PoshCode Archive  Artifact [369c17b282]

Artifact 369c17b282a58aefaecf1e3b6c61ed00c84619c10254c7068d1edb2bc3c929e2:

  • File New-DesktopIni.ps1 — part of check-in [8f04776686] at 2018-06-10 14:02:59 on branch trunk — Create a desktop.ini in your PowerShell folder setting the icon and messing with the display name. (user: Joel Bennett size: 737)

# encoding: ascii
# api: powershell
# title: New-DesktopIni
# description: Create a desktop.ini in your PowerShell folder setting the icon and messing with the display name.
# version: 1.0
# type: class
# author: Joel Bennett
# license: CC0
# x-poshcode-id: 5865
# x-archived: 2015-05-23T02:30:54
# x-published: 2015-05-21T03:40:00
#
#
$di = [System.IO.FileInfo]"$(split-path $Profile -Parent)\desktop.ini"
set-content $di "[.ShellClassInfo]`r`nLocalizedResourceName=1$([char]160)WindowsPowerShell`r`nIconResource=C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe,0`r`n[ViewState]`r`nFolderType=Documents"
$di.Attributes = $di.Attributes -bor [IO.FileAttributes]"System,Hidden" -bxor [IO.FileAttributes]"Archive"