I am doing a lot of power shell lately, and recently discovered the profiles concept, which let’s you keep all your favorite PS scripts organized in a single place and makes them available to you from all your drives, very similar to your dos environmental variables, it certainly saves a lot of time….
As of know my profile includes the following gathered from various posts on the internet…
**Update**: added method for clearing event log and referenced the same while restarting biztalk..
function .CTFSGet-LatestVersion() {
$login=”dev\username,pwd”
$location = get-location
tf.exe get $location /version:T /recursive /force /login:$login
}
function .CClearEventLog() {
Clear-EventLog -LogName Application
}
function .CRestartBizTalk() {
get-service *BizTalkServerApplication*
get-service *BizTalkServerApplication* | foreach-object -process {restart-service $_.Name}
get-service *BizTalkServerApplication*
.CClearEventLog
}
In order to create a new PS profile run the following cmd and later “notepad $profile” to edit the same.
new-item -path $profile -itemtype file -force