I am creating a Visio diagram and I need to use the Off-page reference. Unlike other shapes that I can double click to assign a text, when I double click on an Off-page reference, it redirects me to its referenced shape in another page.
So how can I add text to my Off-page reference? Here are two ways:
1) Left-click on the Off-page reference, and press the F2 key, or
2) Left-click on the Off-page reference, and click the Text command on the toolbar (Home ribbon). Shortcut key is CTRL+2.
Also make sure that you check the "Keep shape text synchronized" option when initially creating an Off-page reference. This will ensure that changes to the text of any of the shape references will be automatically reflected to the other (avoiding possible confusion if you happen to have a number of references).
*joychua97
Wednesday, February 22, 2012
Friday, February 17, 2012
Running InstallUtil unattended
The following command runs InstallUtil.exe unattended and passing username and password:
IMPORTANT NOTE: The switches (username, password, etc) must be placed before the name of the service to be installed, otherwise the switches will not be used. I made this mistake so I initially thought that these switches were not working :)
Use the /? or /help switch to learn more about the other options that can be used in installing the service
*joychua97
InstallUtil.exe /unattended /username=<domain\username> /password=<password> Service.exe
IMPORTANT NOTE: The switches (username, password, etc) must be placed before the name of the service to be installed, otherwise the switches will not be used. I made this mistake so I initially thought that these switches were not working :)
Use the /? or /help switch to learn more about the other options that can be used in installing the service
InstallUtil.exe /? Service.exe
*joychua97
Redirecting output of PowerShell scripts
Now I have finished creating the first part of my PowerShell script, and I now want to create some sort of logging instead of just having the output printed on the console. So I need to redirect the output to a log file, and still see on the console what is being written to the file.
To achieve this, I used Tee-Object as shown below. This will redirect even the error messages to the log file and continuously display the contents of the file as it is written to.
./samplescript "input parameters" 2>&1 | Tee-Object "logfile.txt"
To redirect just the output to the log file and leave error messages to the console:
./samplescript "input parameters" > "logfile.txt"
Here are the other Windows PowerShell redirection operators:
Reference: http://technet.microsoft.com/en-us/library/dd315283.aspx
*joychua97
To achieve this, I used Tee-Object as shown below. This will redirect even the error messages to the log file and continuously display the contents of the file as it is written to.
./samplescript "input parameters" 2>&1 | Tee-Object "logfile.txt"
To redirect just the output to the log file and leave error messages to the console:
./samplescript "input parameters" > "logfile.txt"
Here are the other Windows PowerShell redirection operators:
| Operator | Description | Example |
|---|---|---|
| > | Redirects output to the specified file, overwritting its current contents. | ./samplescript "input parameters" > "logfile.txt" |
| >> | Appends output to the current contents of hte file. | ./samplescript "input parameters" >> "logfile.txt" |
| 2> | Sends errors to the specified file. Overwritting its current contents. | ./samplescript "input parameters" 2> "errorfile.txt" |
| 2>> | Appends errors to contents of the specified file. | ./samplescript "input parameters" 2>> "errorfile.txt" |
| 2>&1 | Sends error messages to the success output stream | ./samplescript "input parameters" 2>&1 "logfile.txt" |
Reference: http://technet.microsoft.com/en-us/library/dd315283.aspx
*joychua97
Wednesday, February 15, 2012
TF.exe commands
Looking for tf.exe commands to include in my PowerShell script, and the reference in http://msdn.microsoft.com/en-US/library/1yft8zkw(v=vs.80).aspx is quite helpful.
I'll update this post with the exact commands later on :)
*joychua97
I'll update this post with the exact commands later on :)
*joychua97
Redirecting PowerShell script output to a file
I just wanted to redirect my PowerShell script output to a file, and at the same time see what's being written to the file.
This command does the trick:
D:\Scripts\Sample.ps1 2>&1 |Tee-Object -File D:\Logs\myScriptLog.log
Reference:
http://stackoverflow.com/questions/3822650/how-can-i-output-handbrake-output-to-both-the-screen-and-to-a-file
*joychua97
This command does the trick:
D:\Scripts\Sample.ps1 2>&1 |Tee-Object -File D:\Logs\myScriptLog.log
Reference:
http://stackoverflow.com/questions/3822650/how-can-i-output-handbrake-output-to-both-the-screen-and-to-a-file
*joychua97
Restoring default icon for .dll files
I opened some .dll and .pdb files in Notepad, and now their icons was changed, and the recommended program is now Notepad. Not something that I want :)
To fix this, I did these steps. I think the combination of these steps worked
1) Opened regedit and browsed to HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\FileExts\filetype\OpenWithList
> Removed all values under the OpenWithList key. Retained only the (Default) value
> Removed the UserChoice key
2) Lastly, opened up command prompt as an Administrator, and ran "assoc .dll=dllfile"
References: http://technet.microsoft.com/en-us/magazine/ee851670.aspx http://answers.microsoft.com/en-us/windows/forum/windows_vista-files/restore-default-file-icon-of-file-types-dll-and/6917a74b-2f99-44ed-86a3-7bd52d240b7e
*joychua97
To fix this, I did these steps. I think the combination of these steps worked
1) Opened regedit and browsed to HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\FileExts\filetype\OpenWithList
> Removed all values under the OpenWithList key. Retained only the (Default) value
> Removed the UserChoice key
2) Lastly, opened up command prompt as an Administrator, and ran "assoc .dll=dllfile"
References: http://technet.microsoft.com/en-us/magazine/ee851670.aspx http://answers.microsoft.com/en-us/windows/forum/windows_vista-files/restore-default-file-icon-of-file-types-dll-and/6917a74b-2f99-44ed-86a3-7bd52d240b7e
*joychua97
Wednesday, February 8, 2012
PowerShell Cmdlets
Here are some PowerShell cmdlets that others might find helpful (as they are very much helpful to me). For more details, you may refer to http://technet.microsoft.com/en-us/library/ee156818.aspx.
*joychua97
Cmdlet
|
Usage
|
Example
|
| Get-ChildItem | Returns items in the specified folder | Get-ChildItem $folder -include *.cs -force -recurse |
| Copy-Item (cpi) | Copy files or folders | Copy-Item $folder/$file -force -recurse cpi $folder/$file -force -recurse |
| Remove-Item (ri) | Delete files or folders | Remove-Item $folder -force -recurse ri $file -force |
| New-Item (ni) | Create new files or folders | New-Item $folder -type directory ni $file -type file -force |
| Invoke-Item (ii) | Run executable file or open a file. Alternatively prefix the script with an ampersand (&) and make sure to enclose parameters with spaces in double quotes | Invoke-Item $script ii $script & $script "parameter1" "parameter2" |
| Get-Location (gl) | Returns the current folder | $currentDirectory = Get-Location |
| Set-Location (sl) | Change the current folder | Set-Location $newFolder sl $newFolder |
*joychua97
Subscribe to:
Posts (Atom)
