09.01.2009, 18:05 | #1 |
Участник
|
axcoder: PowerShell + Ax
Источник: http://axcoder.blogspot.com/2009/01/powershell-ax.html
============== Just added a small article to axaptapedia about administering Ax with PowerShell. Источник: http://axcoder.blogspot.com/2009/01/powershell-ax.html
__________________
Расскажите о новых и интересных блогах по Microsoft Dynamics, напишите личное сообщение администратору. |
|
09.01.2009, 18:05 | #2 |
Участник
|
axaptapedia: PowerShell
Источник: http://www.axaptapedia.com/PowerShell
============== Summary: /* Something like SQL */ PowerShell is a brand new command line interface for Windows. Here are some information for administering Dynamics Ax with PowerShell PSh has some advantages such as *object oriented interface between commands *using Microsoft .NET framework (so, I think, in can use business comnector) *graphical shell == Hand grenade instead of sniper rifle == If you use Windows Explorer, you can find some new abilities to work with groups ob objects. Unlike cmd.exe, PowerShell can work with object of different nature same way. For example, here is a command which stop all AOSes spsv aos* where spsv is commandlet for stopping services, aos* is a mask for all services which have name starting with string "aos" == Fire and forget == Sometimes I need to start aos after deltion of application indexes. When I do it with "services" control panel applet, it waits for a while than in outputs a messages, saying that service start takes longer than expected and stops to monitor service starting. That how I do it wth PSh: [[Image:Powershell.png]] * I enter "sasv aos`$*1done" * this command ** starts the service ** wait while it starts ** informing me about service is running Where * sasv - the alias for the Start-Service commadlet * aos`$*1 - name of te aos service (you can type "gsv aos*" to list all AOSes with names and secription, buck sign has a special meaning in PSh so it is escaped with `. when I am working with Ax 2009, I write just like "sasv aos5*1" because there is no any other service which is matcving such a mask) * done - is a function which is defined in [http://www.axaptapedia.com/Image:Mic...ll_profile.zip my profile] outputting just a message "done" [System.Reflection.Assembly]::LoadWithPartialName("System.Windows.Forms") function msgBox($x){ [System.Windows.Forms.MessageBox]::Show($x, 'Done!:PowerShell', [Windows.Forms.MessageBoxButtons]::OK, [Windows.Forms.MessageBoxIcon]::Information, [Windows.Forms.MessageBoxDefaultButton]::Button1, [Windows.Forms.MessageBoxOptions]::ServiceNotification ) } function done(){ msgBox("done") } So there is no need to switch to "services" applet constantly pressing "Refresh" == Something like SQL == PowerShell have some commands which work like sql. For example, when I looking for extendions of indezes which are related to application labels, I typed the following ls *ru* | group extension it means output all files, that have "ru" substring in name and group it by extension Count Name Group ----- ---- ----- 1 .ahi {C:\Program Files\Microsoft Dynamics AX\50\Application\Appl\Dynamics... 1 .alt {C:\Program Files\Microsoft Dynamics AX\50\Application\Appl\Dynamics... 1 .ahd {C:\Program Files\Microsoft Dynamics AX\50\Application\Appl\Dynamics... 1 .alc {C:\Program Files\Microsoft Dynamics AX\50\Application\Appl\Dynamics... 1 .ald {C:\Program Files\Microsoft Dynamics AX\50\Application\Appl\Dynamics... 1 .ali {C:\Program Files\Microsoft Dynamics AX\50\Application\Appl\Dynamics... It printed groups, whith the following columns: * count - number of elements in the group * name - name of the group * group - elements in the group because I wanted only names, I typed: ls *ru* | group extension | select name which has in result Name ---- .ahi .alt .ahd .alc .ald .ali == links == * [http://stevegilham.blogspot.com/2008...p3-is-out.html Workaround to change group policy for CTP3] * [http://code.google.com/p/farnet/ PowerShell plugin for FarManager] * [http://www.axaptapedia.com/Image:Mic...ll_profile.zip My profile] for PowerShell v2 CTP 2 Источник: http://www.axaptapedia.com/PowerShell
__________________
Расскажите о новых и интересных блогах по Microsoft Dynamics, напишите личное сообщение администратору. |
|
|
|