An Introduction to PowerShell – basics and how to define Variables

PowerShell is built into Windows, so there is no requirement of separate fee or licensing cost. In addition, different server products come with their own Power Shells, too, which expands the capability to do things you want using PowerShell.

For demo purpose I am using Windows PowerShell ISE.

PS-1

An introduction to scripts

Scripts in PowerShell are basically just text files with the special filename extension of ps1.

To create a script, you enter a series of PowerShell commands in a sequence in a new Notepad file or any text editor you like, and then save that file with extension as .ps1, where name of your file is a friendly description of your script with no spaces.

 

PS-2

How do I run my scripts?

To run a PowerShell script that you already have, you enter in a PowerShell window either:

The full path (folder and file name) of the script, like so: c:\powershell\myscript.ps1

Or

If your script is in the current directory the console is looking at, use a period and then a backslash, like this: .\myscrip.ps1

Other than this, there is nothing special needed for creating a script in PowerShell. You can simply add the commands you like.

 

PS-3

How do I define Variables?

In PowerShell, variables always have a dollar sign ($) prefixed before them.

Let us declare few variables right now:

$name = ‘Ashwini’

$anynumber = 111074

$location = ‘Ghaziabad’

$listofnumbers = 15,20,35,40

 

PS-4

If I want to define a variable with text as its value, I will require to add a single quote on either side of the text value.

Let’s say we want to find out the total number of cmdlets available on the system, we can use:

(get-command).count

 

PS-5

Let’s declare a variable to store that count in. We’ll call it

$numbersofcmdlets

We will store output in this variable of the (get-command).count .

$numbersofcmdlets = (get-command).count

Now we can use this variable as part of something else.

For a simple example, let’s look at the Write-Host cmdlet, which simply writes text to the screen of the machine hosting the PowerShell session. Write-Host has a lots of capabilities, but in its simplest form, you can just say:

Write-Host “Dynamics Nav Blog Site by Ashwini Tripathi”

You can integrate variables with Write-Host. You just call them with the dollar sign notation and work them right into your text.

For example, I can say:

Write-Host “There are $numbersofcmdlets commands available for use on this system.”

 

PS-6

I will come up with more stuffs in my upcoming posts. 

Till then keep practicing and stay tuned for more details.

 

 

Basics of Demand, Forecast, MPS & MRP

What is MPS?

MPS term is used for Master Production Schedule. It is used to plan items which have direct demand. Like Sales Order, Service Orders and Forecasts. It is run Weekly based on Orders and forecasts for that period.

What is MRP?

MRP term is used for Material Requirements Planning. It is used to plan items which have dependent demand. Like sub items used to produce FG or are defined in BOM. It is run Daily to expedit parts required to produce the plan.

What is Forecast?

Forecasting allows your company to create “what if” scenarios and efficiently and cost-effectively plan for and meet demand. Accurate forecasting can make a critical difference in customer satisfaction levels with regard to order promising dates and on-time delivery.

The forecasting functionality in the program can be used to create sales or production forecasts, in combination or independently.

What is Demand?

Calculation is done order-by-order, meaning that the order that includes the demand line with the earliest due date or shipment date is considered first, and all other demand lines in that production order, irrespective of their individual due dates or shipment dates, are also calculated for that order. When the calculation is completed, all unfulfilled demand is displayed as planning lines, sorted by the earliest demand date, with the various quantity fields filled in.

Actual demand is calculated from Sales Order, Service Orders, Components Needed, Job Planning Lines.

This demand is compared with the Forcasted demands like defined in Production Forecast.

Regenerative Plan is calculated as per Period, MPS, MRP and other provided parameters.

Lets understand this via a simple Example:

Step-1

Define Forecast for Item A as requirement of 1000 Qty for Jan Month.

Step -2

Run the Regenerative Plan, you will get the Planning for Item A with due date as 1st Jan of 1000 Qty.

Let us see what happens under different demand levels.

Scenario-1

When demand is less than Forecast for the month.

Let us Make a Sales Order for 200 Qty of Item A.

Lets see the impact of this on our Plan.

Sales demand is for 200 Qty

Forecast demand will be for 800 Qty (1000 – 200)

Actual demand in this case is of 200 Qty

If we run our Plan 2 lines will be created as below

a) 200 Qty with due date equivalent to Sales Order date

b) 800 Qty with due date as 1st Jan from Forecast

If we see our Total demand is still 1000 Qty

Scenario-2

When demand is equal to Forecast for the month.

Let us Make a Sales Order for 1000 Qty of Item A.

Lets see the impact of this on our Plan.

Sales demand is for 1000 Qty

Forecast demand will be for 0 Qty (1000 – 1000)

Actual demand in this case is of 1000 Qty

If we run our Plan 1 line will be created as below

a) 1000 Qty with due date equivalent to Sales Order date

If we see our Total demand is still 1000 Qty

Scenario-3

When demand is greater than Forecast for the month.

Let us Make a Sales Order for 1500 Qty of Item A.

Lets see the impact of this on our Plan.

Sales demand is for 1500 Qty

Forecast demand will be for 0 Qty

Actual demand in this case is of 1500 Qty

If we run our Plan 1 line will be created as below

a) 1500 Qty with due date equivalent to Sales Order date

If we see our Total demand is now 1500 Qty

Will comeup with more details in my upcomming posts.

Basics of Power Pivot for Excel – 2013

Dear friends, I have published couple of posts on this topic. I will be adding more advanced features and details related to this in my upcoming posts.

For your ready reference below I present Links to those posts.

PowerPivot for Excel

Start the Power Pivot in Microsoft Excel add-in

Troubleshooting: Power Pivot Ribbon Disappears

PowerPivot Creating a Data Model in Excel 2013

Adding more tables to the Data Model using Existing Connection – In PowerPivot

Add relationships to Data Model in PowerPivot

How to add Filter for data retrieval in PowerPivot Data model.

Create a calculated column in PowerPivot

Creating My First Report using PowerPivot

In Excel 2013, PowerPivot and Power View are no longer separate add-ins that need to be downloaded and installed. These add-ins are natively included.

PowerPivot in Excel 2013 is functionally very similar to the PowerPivot add-in for Excel 2010.

PowerPivot is an add-in that lets end users gather, store, model, and analyze large amounts of data in Excel. Power View provides intuitive data visualization of PowerPivot models and SQL Server Analysis Services (SSAS) tabular mode databases.

If you’re unfamiliar with either PowerPivot or Power View, I encourage you to first review my previous post links provided above to understand the basics.

Some parts of the PowerPivot architecture is embedded inside of Excel 2013.

  • The PowerPivot version in Excel 2013 no longer uses a separate PowerPivot Fields list. Instead, the built-in PivotTable Fields list is used. This means that some capabilities from the Excel 2010 add-in (e.g., searching for fields by name, creation of slicers from the field list, surfacing of column descriptions when hovering over a field) are no longer available.
  • Workbooks with PowerPivot models are no longer limited to 2GB in size in Excel 2013. However, the 2GB limit still applies to workbooks that will be published to SharePoint.
  • In Excel 2013, a refresh of a PivotTable or PivotChart will, by default, initiate a refresh of the underlying data connections in the Data Model. This is very different from Excel 2010, where a PivotTable refresh only re-queries the model. The new refresh behaviour can be changed by clicking Connections on the Data tab, selecting Properties, and clearing the Refresh this connection on Refresh All check box.
  • Stay tuned for more information on this topic. Till then keep practicing & exploring.
  • In Excel 2013, a Power View “report” is a worksheet rather than an .rdlx file. There’s no concept of multiple report views. Instead, multiple Power View worksheets can be created within a single Excel workbook.

Stay tuned for more information on this topic. Till then keep practicing & exploring.

Important

Most of the contents you find in this blog will be either inherited from MSDN or Navision Developer IT Pro Help. Some places images are also directly taken from these sites. Purpose is simple to try those stuffs and re-produce adding few things as per my understanding to make easy understanding for others and quick reference.

Here nothing under my own brand or authorship of the content. At any point of time we are just promoting Microsoft stuffs nothing personnel with same.

Hope stuffs used here will not violate any copyright agreement with them. In case by mistake or in-intestinally it happens and the Microsoft feels these should not be used Microsoft have full right to inform me about same and will be glad to take down any such content which may be violating the norms.

Purpose is to promote Navision and share with community.

FB Profile

Like FB Page

%d bloggers like this: