AXForum  
Вернуться   AXForum > Microsoft Dynamics AX > DAX Blogs
All
Забыли пароль?
Зарегистрироваться Правила Справка Пользователи Сообщения за день Поиск Все разделы прочитаны

 
 
Опции темы Поиск в этой теме Опции просмотра
Старый 09.01.2009, 18:05   #1  
Blog bot is offline
Blog bot
Участник
 
25,617 / 848 (80) +++++++
Регистрация: 28.10.2006
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  
Blog bot is offline
Blog bot
Участник
 
25,617 / 848 (80) +++++++
Регистрация: 28.10.2006
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, напишите личное сообщение администратору.
 

Похожие темы
Тема Автор Раздел Ответов Посл. сообщение
axStart: Microsoft Dynamics AX 2009 Hot Topics Web Seminar Series Blog bot DAX Blogs 0 06.08.2008 12:05
axcoder: How to hide Content Pane in Ax 2009 Blog bot DAX Blogs 0 02.07.2008 00:07
Arijit Basu: AX 2009 - Quick Overview Blog bot DAX Blogs 4 19.05.2008 14:47
axcoder: Book review: “Quality Assurance for Dynamics AX-Based ERP Solutions” Blog bot DAX Blogs 0 27.04.2008 18:07
axcoder: How to setup Ax 4 on a computer which does not belong to any domain Blog bot DAX Blogs 0 07.12.2007 12:00
Опции темы Поиск в этой теме
Поиск в этой теме:

Расширенный поиск
Опции просмотра

Ваши права в разделе
Вы не можете создавать новые темы
Вы не можете отвечать в темах
Вы не можете прикреплять вложения
Вы не можете редактировать свои сообщения

BB коды Вкл.
Смайлы Вкл.
[IMG] код Вкл.
HTML код Выкл.
Быстрый переход

Рейтинг@Mail.ru
Часовой пояс GMT +3, время: 01:18.