A faster and more modern method for setting company and location variables
An even better, faster and more modern method for setting company and location variables is just using the registry. In my previous article about dynamic scripting I was using environment variables, now I just use the registry. A sample powershell script: $PC_COMPANY = (Get- ItemProperty HKLM:\SOFTWARE\COMPANYVAR\PC_COMPANY).PC_COMPANY Write-Output "Original registry key: $($PC_COMPANY)" #$PC_LOCATION = (Get- ItemProperty HKLM:\SOFTWARE\COMPANYVAR\PC_LOCATION).PC_LOCATION #Write-Output "Original registry key: $($PC_LOCATION)" if ((Get- WmiObject Win32_OperatingSystem).name - notmatch "XP") { $ programfiles = (Get-Content env :" ProgramFiles (x86)") } $Destination = "$ ProgramFiles \Elements\ ElementsOutlook \ ElementsOutlook \ Config \" New-Item - ItemType Directory -Path $Destination i...