0 votes

I need to insert this condition:

# The condition is met if $Context.ConditionIsMet is set to $True.
# $Context.ConditionIsMet = $False

$day = Get-Date -UFormat %V

$Context.ConditionIsMet = (($day -eq 1)-or ($day -eq 5))

The %V form is not accept in adaxes but is correct in powershell. Any suggest? I need to get week number of month in gregorian calendar. Thanks in advance, Simone

by (250 points)

1 Answer

0 votes
by (220k points)
selected by
Best answer

Hello Simone,

The thing is that in Adaxes scripts the percent (%) character is considered to be the beginning or the end of a value reference. To achieve the desired, you need to double the character in your script. Finally, it should be as follows:

$day = Get-Date -UFormat %%V

$Context.ConditionIsMet = (($day -eq 1) -or ($day -eq 5))

Related questions

0 votes
1 answer

Let's say I have a Business Rule that is fired prior to adding members to a group. Is it possible to get the number of objects being added to that group as ... that tells me that 6 objects will be added or is each added user treated completely independently?

asked Apr 20 by ngb (90 points)
0 votes
1 answer

Hello, i have a custom command which sets the oof-message for the selected user. in this custom command i have a parameter "param-vertretung" (ad-object picker). Now i want to ... and email of the stand-in in the oof-message. Can you help me with that? Thanks

asked Nov 13, 2020 by lohnag (100 points)
0 votes
1 answer

I'm attempting to build a custom PS command that will return the number of mailboxes per database in our Exchange 2010 environment. This is the script I'm using which works ... -Database $_.Name).Count} How can I make this work through Adaxes Custom Command?

asked Dec 7, 2012 by mdeflice (350 points)
0 votes
0 answers

It would be great if we could run a report on an OU and get the following information: Computer Name Local Accounts Whether or not the account is an administrator ... this is less important. Thanks in advance. Your support team is great and appreciated.

asked Sep 8, 2021 by mikek (80 points)
0 votes
1 answer

Hello, we want to setup a scheduled report with all our teams (security groups) and their respective team-leader (specified in "managedBy" of security group). I get the name of ... the team-leader. And this is my problem... Can you help me with this problem?

asked Oct 9, 2020 by lohnag (100 points)
2,733 questions
2,470 answers
6,460 comments
1,339,577 users