![]() Therefore you can follow this knowledge base and achieve shared storage requirement to make/setup your high available environment for testing purpose. Now a day’s VMware workstation is in full swing to make/setup the testing environment while shared storage is easily not available for testing. “xopenFont color=Redxclose” -f (Get-Date -displayhint date),$env:userdomain,$env:username)ĬonvertTo-Html -head $head -body $fragments | Out-File c:\Report.htm #I’m using place holders for the characters #define a collection of drives from the group object $groups=$Data | Group-Object -Property SystemName $data=Get-WmiObject -Class Win32_logicaldisk -filter “drivetype=3” -computer $computers Step 2: then in tools ~/Documents/tools/profile.$computers = (Get-Content “C:\Scripts\Computers.txt”) Set-ExecutionPolicy -Scope CurrentUser Unrestricted # Make sure Powershell profile is readable $content = ~/Documents/tools/profile.ps1", # this is your auto-generated powershell profile to be installed Md $psdir -ErrorAction Silentl圜ontinue | out-null $psfile = $psdir "\Microsoft.PowerShell_profile.ps1" $psdir = "$env:USERPROFILE\Documents\WindowsPowerShell" # AND INSTALLS A POINTER TO A GLOBAL POWERSHELL PROFILE ![]() # THIS SCRIPT BLOWS AWAY YOUR DEFAULT POWERSHELL PROFILE SCRIPT Step 1: Create a Powershell Profile: FILE: install_profile.ps1 C:\Windows\SysWow64\WindowsPowerShell\v1.0 for the 32bit one (Yeah I know, the folder naming is counterintuitive, but it's correct).C:\Windows\System32\WindowsPowerShell\v1.0 for the 64bit environment.You should consider both environments if you want to always execute the profile code. If you really need to execute the profile code for every user, mind that the $PsHome path is different for 32bit and 64bit instances of PowerShell. This is safer because you don't pollute other users' space (usually, you don't want to do that).Īnother advantage is that you don't need administrator rights to add the file to your user-space (you do for anything in C:\Windows\System32). This means the user-specific commands will overwrite variables in case of duplicates or conflicts.Īlways put the code in the user-specific profile if there is no need to extend its execution to every user. If both paths contain a profile.ps1 file, the all-users one is executed first, then the user-specific one. IMPORTANT: remember you need to restart your PowerShell instances to apply the changes. $PsHome ( C:\Windows\System32\WindowsPowerShell\v1.0): every user will execute this code.You can quickly find your profile location by running echo $profile in PowerShell ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |